Checking answer vs. mathematica (2nd order equidimensional non homog. ODE)

  • Thread starter Thread starter iqjump123
  • Start date Start date
  • Tags Tags
    Mathematica Ode
iqjump123
Messages
58
Reaction score
0

Homework Statement



Obtain general solution:

x^2 y''(x)-2 x y'(x)+2 y(x) = x^2+2

Homework Equations



Using Euler Cauchy method, and using variation of parameters

The Attempt at a Solution



Hey all, I have been struggling with this problem since yesterday in obtaining the particular solution.

First of all, I thought I could use the method of undetermined coefficients, and made the guess as yp=(Ax2+Bx+C)*x (since the initial guess includes the complimentary solution), but noticed everything just goes to 0.

So I used the Variation of Parameters method. The answer I obtained was:
y(x) = c_2 x^2+c_1 x+x^2 log(x)+1-x^2.

However, when I tried solving this DE in wolfram alpha, it gave me
y(x) = c_2 x^2+c_1 x+x^2 log(x)+1. (no x^2 term)

i tried solving this back and forth and rechecking my answer to see what my problem is, but I can't see what is wrong.

Any insight will be helpful!

Thanks so much, as always :)

iqjump123
 
Physics news on Phys.org
Maybe you typed the problem into Wolfram Alpha incorrectly. Mathematica gives me the same solution you found by hand.
 
vela said:
Maybe you typed the problem into Wolfram Alpha incorrectly. Mathematica gives me the same solution you found by hand.

Thanks for the *lightning fast* reply, vela!
I will go ahead and check it out- but i think the fact that you got the same answer gives me assurance :)
 
The solutions are the same. The constant c2 is different in the two solutions.

In the WolframAlpha solution, call it C2' .

Then let C2' = c2 - 1, where c2 refers to the answer you obtained.

So basically, c2x2 of the WolframAlpha solution has absorbed c2x2 - x2 of your solution.
 
*facepalm*
 
vela said:
*facepalm*
Come on vela. You didn't actually say that the WolframAlpha answer was wrong. You merely confirmed OP's solution.
 
Since, according to you, the problem specifically says "Using Euler Cauchy method, and using variation of parameters", why do you then say "I thought I could use the method of undetermined coefficients"?
 
HallsofIvy said:
Since, according to you, the problem specifically says "Using Euler Cauchy method, and using variation of parameters", why do you then say "I thought I could use the method of undetermined coefficients"?

First of all, vela- may I ask why you "facepalm"ed?

Second, HallsofIvy, I mentioned the question as such, because I ended up using variation of parameters, but I thought I could use the method of undetermined coefficients.
After all, using the method of u. c. is an easier alternative if the non homogenous solution is in the standard form. I was merely asking for some insight on if the reason I couldn't use MUC (If I can't)?

thanks.
 
I should've noticed the two solutions were actually the same, just written differently.

As far as I know, the method of undetermined coefficients only works when the DE has constant coefficients.
 
  • #10
I thought you were facepalming to my reaction lol. Anyways- good point about the conditions on using m.u.c- it actually seems that v of p is the way that works.

Thanks to all who contributed:)
 
Back
Top