pde = 1/Cosh[x]*D[Cosh[x]*D[T2[x, y], x], x] + 1/Sin[y]*D[Sin[y]*D[T2[x, y], y], y] == 0
sol[x0_] := NDSolve[{pde, T2[ArcTanh[x0], y] == 1, T2[xf, y] == 0}, T2[x, y], {x, ArcTanh[x0], 40}, {y, 0, 180 Degree}];
EG[x_, y_, x1_] := 1/(Cosh[x]^2 - Sin[y]^2)*((D[T2[x, y] /. sol[x1], x])^2 + (D[T2[x, y] /. sol[x1], y])^2)
EG[1, 1, 0.2]
General::ivar: 5 is not a valid variable.
I can see the issue in EG is that its unable to take derivative first and then sub the value. How can I overcome this?
NDSolve[]
? Or, making them private with e.g.Module[]
? $\endgroup$