# Question:why such large difference in dsolve answer using two methods of solving

## Question:why such large difference in dsolve answer using two methods of solving

Maple 2023

This is linear ode, third order, Euler type and inhomogeneous ode.

If I solve the homogeneous ode only, then ask Maple to give me a particular solution, then add these, I get much much smaller solution which Maple verifies is correct.

Now when asking Maple to solve the original inhomogeneous ode as is, the solution is much more complicated and much longer with unresolved integrals.

Why does not Maple give the simpler solution? Both are verified to be correct.

This is my theory: When asking maple to find only the particular solution, it seems to have used a different and advanced method to find yp. Which is new to me and trying to learn it. It is based on paper "D'Alembertian Solutions of Inhomogeneous Equations (differential, difference, and some other).

Undetermined coefficients method can't really be used on ode's such as this because its coefficients are not constant.

Now, when asking Maple to solve the inhomogeneous ode, it seems to have used variation of parameters method, which results in integrals, which can be hard to solve.

My question is: Why does not Maple give the same much shorter answer when asked to solve the ode as is? Should it not have done so? Any thoughts on why such large difference in answer? Why it did not use the same method to find yp when asked to solve the whole ode as that leads to much smaller and more elegant solution.

ps. debugging this, it uses LinearOperators:-dAsolver:-dAlembertianSolver which is called from ODEtools/particularsol/linear to find yp when calling DETools:-particularsol(ode); but for some reason, it does not do this when asking it to solve the whole ode directly (if it did, then one will expect same answer to result, right?)

Maple 2023.2 on windows 10.

 > restart;
 (1)
 > #the ode ode:=x^3*diff(y(x), x, x, x) + x^2*diff(y(x), x, x) + 2*x*diff(y(x), x) - y(x) = 2*x^3 - ln(x);
 (2)
 > # find y_h yh:=dsolve(lhs(ode)=0);
 (3)
 > #find particular solution yp:=DETools:-particularsol(ode);
 (4)
 > #test particular solution is correct odetest(yp,ode);
 (5)
 > #find general solution = yh+ yp y_general:=y(x)=rhs(yh)+rhs(yp);
 (6)
 > #test general solution is correct odetest(y_general,ode);
 (7)
 > #now solve the ode directly using Maple. Why this solution is much more complicated? y_general_direct_method:=dsolve(ode);
 (8)
 > #test the above odetest(y_general_direct_method,ode);
 (9)
 >