# Homework Help: Checking answer vs. mathematica (2nd order equidimensional non homog. ODE)

1. Aug 17, 2011

### iqjump123

1. The problem statement, all variables and given/known data

Obtain general solution:

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

2. Relevant equations

Using Euler Cauchy method, and using variation of parameters

3. 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

2. Aug 17, 2011

### vela

Staff Emeritus
Maybe you typed the problem into Wolfram Alpha incorrectly. Mathematica gives me the same solution you found by hand.

3. Aug 17, 2011

### iqjump123

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 :)

4. Aug 17, 2011

### SammyS

Staff Emeritus
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.

5. Aug 17, 2011

### vela

Staff Emeritus
*facepalm*

6. Aug 17, 2011

### SammyS

Staff Emeritus
Come on vela. You didn't actually say that the WolframAlpha answer was wrong. You merely confirmed OP's solution.

7. Aug 18, 2011

### HallsofIvy

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"?

8. Aug 18, 2011

### iqjump123

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.

9. Aug 18, 2011

### vela

Staff Emeritus
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. Aug 18, 2011

### iqjump123

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:)