Answer
The potential energy at B is $~~15~J$
Work Step by Step
Since the work done on the particle is $+25~J$, the kinetic energy at B is $25~J$ more than the kinetic energy at A.
That is: $~~K_B = K_A+25~J$
We can use conservation of energy to find the potential energy at B:
$K_B+U_B = K_A+U_A$
$(K_A+25~J)+U_B = K_A+U_A$
$U_B = U_A-25~J$
$U_B = 40~J-25~J$
$U_B = 15~J$
The potential energy at B is $~~15~J$