DSolve[Derivative[2][y][x] == (Derivative[1][phi][x]*Derivative[1][y][x])/(-phi[a] + phi[x]) - (y[x]*(-(n*(1 + n)*(-phi[a] + phi[x])^2) + Derivative[2][phi][a]))/(-phi[a] + phi[x]),y[x],x]