I saw this DE in Maple forum. When solving it using Mathematica 9.01, even though the result was correct (both solutions gave the same numerical answer for some random values), Mathematica's answer was much larger in size.
Using Simplify
or FullSimplify
did not help much (expression was still order of magnitude larger than Maple's result). I think special simplification rules might be needed?
I'd like to ask if there are other special simplifications to use, or commands I might be missing to reduce this result more. Below is the ODE and Maple and Mathematica results.
Mathematica:
ClearAll[y, x];
ode = y'''[x] + (1/x) y'[x] - (1/x^2) y[x] == 0;
ic = {y[1] == 1, y'[1] == 0, y''[1] == 1};
sol = y[x] /. First@DSolve[{ode, ic}, y[x], x];
Simplify[sol]
Result is too large fit in the margin of this answer, so I zoomed in
Maple:
ode:=diff(y(x),x$3)+(1/x)*diff(y(x),x)-y(x)/x^2=0;
dsolve({ode, y(1)= 1, D(y)(1)=0, (D@@2)(y)(1)=1});
simplify(%,wronskian);
y(x) = 2*x-(BesselY(0, 2)-2*BesselY(1, 2))*Pi*sqrt(x)*
BesselJ(1, 2*sqrt(x))+Pi*(-2*BesselJ(1, 2)+BesselJ(0, 2))
*sqrt(x)*BesselY(1, 2*sqrt(x))
Update
Here is Maple result written using Mathematica notation in case someone wants to use to help find simplification to Mathematica solution. Also tried Simplify[mma == maple]
suggested in the comments below.
ClearAll[y, x];
ode = y'''[x] + (1/x) y'[x] - (1/x^2) y[x] == 0;
ic = {y[1] == 1, y'[1] == 0, y''[1] == 1};
mma = y[x] /. First@DSolve[{ode, ic}, y[x], x];
maple = 2 x - (BesselY[0, 2] - 2 BesselY[1, 2]) Pi Sqrt[x] BesselJ[1,
2 Sqrt[x]] + Pi (-2 BesselJ[1, 2] + BesselJ[0, 2]) Sqrt[x] BesselY[1,
2 Sqrt[x]];
N[mma /. x -> 3]
(*3.33870606057436*)
N[maple /. x -> 3]
(*3.33870606057435*)
Simplify[mma == maple]
(* too large to post *)