If a varies directly as the square of b, then, you can write the following equation:

where k is the constant of proportionality.
a = 6 when b = 5. Use this information to find the value of k, as follow:

Then, the equation that relates a and b becomes:

Now, if b=2, you obtain for a:

Hence, a = 24/25 when b = 2