Solve the differential equation: (dy/dx) + P(x)*y = Q(x)

FritoTaco

New member
Joined
Nov 14, 2015
Messages
42
Hello, I'm solving this equation for y, but the computer system says it's wrong. Any ideas?

Equations:

\(\displaystyle \dfrac{dy}{dx}+P(x)y=Q(x)\) get function into this form before using the equation below this.

\(\displaystyle \displaystyle I(x)=e^{\int P(x)}\)


\(\displaystyle \displaystyle \int udv = uv-\int vdu\)

Work:

1. \(\displaystyle xy'-2y=x^2\)

2. \(\displaystyle \dfrac{dy}{dx}-2y=\dfrac{x^2}{x}\) divide x from the left and change y' into dy/dx

3. \(\displaystyle \displaystyle \dfrac{dy}{dx}-2y=x\) simplify right side

4. \(\displaystyle P(x)=-2\) identify P(x)

5. \(\displaystyle \displaystyle e^{\int -2 dx}\) use second equation and plug in P(x)

6. \(\displaystyle \displaystyle e^{-2x}\) take integral

7. \(\displaystyle e^{-2x}\dfrac{dy}{dx}-2ye^{-2x}=xe^{-2x}\) multiply \(\displaystyle e^{-2x}\) ​through equation from line 3

8. \(\displaystyle \displaystyle \dfrac{d}{dx}ye^{-2x}= \int xe^{-2x}\) write the left side as the derivative of the product of line 7

integration-by-parts since we have a variable \(\displaystyle x\) which is a product of another function (\(\displaystyle e^{-2x}\))

\(\displaystyle u=x\)\(\displaystyle dv=e^{-2x}dx\)
\(\displaystyle du=dx\)\(\displaystyle v=-\dfrac{1}{2}e^{-2x}\)




10. \(\displaystyle \displaystyle ye^{-2x}=-\dfrac{1}{2}xe^{-2x}-\int-\dfrac{1}{2}e^{-2x}dx\) the right hand-side: \(\displaystyle \displaystyle uv-\int vdu\) take the integral of \(\displaystyle -\dfrac{1}{2}e^{-2x}\)

11. \(\displaystyle \displaystyle ye^{-2x}=-\dfrac{1}{2}xe^{-2x}-\dfrac{1}{4}e^{-2x}+C\)

12. \(\displaystyle \dfrac{ye^{-2x}}{e^{-2x}}=\dfrac{-\dfrac{1}{2}xe^{-2x}}{e^{-2x}}-\dfrac{\dfrac{1}{4}e^{-2x}dx}{e^{-2x}}+C\) get y alone

13. \(\displaystyle y=-\dfrac{1}{2}x-\dfrac{1}{4}+Ce^{-2x}\)
 
The first thing I see where you went wrong is at the very beginning, in step 2, when you divided by x. You can't just divide some of the terms by x and leave others unchanged. You have to divide all of them by x. Doing so results in:

\(\displaystyle \dfrac{xy' - 2y}{x} = \dfrac{x^2}{x} \implies \dfrac{dy}{dx} - \dfrac{2y}{x} = x\)

With that small mistake fixed, try continuing and see where you get.
 
Oh okay, now I tried it again but may have gotten another thing wrong.

1. \(\displaystyle \dfrac{xy'-2y}{x}=\dfrac{x^2}{x}\) divide through by x and replace y' with dy/dx

2. \(\displaystyle \dfrac{dy}{dx}-\dfrac{2y}{x}=x\) simplify right side from step 1 and replace y' with dy/dx

3. \(\displaystyle \dfrac{dy}{dx}-2x^{-1}y=x\) rewrite left side

4. \(\displaystyle P(x)=2x^{-1}\) identify P(X)

5. \(\displaystyle \displaystyle I(x)=e^{\int2\cdot\dfrac{1}{x}dx}\) plug P(x) into second equation

6. \(\displaystyle \displaystyle I(x)=e^{2ln(x)}\) take the integral

7. \(\displaystyle e^{2ln(x)}\dfrac{dy}{dx}-2ye^{2ln(x)}=xe^{2ln(x)}\) multiply through by I(x)

8. \(\displaystyle \displaystyle\dfrac{d}{dx}ye^{2ln(x)}=\int xe^{2ln(x)}dx\) write the left side as the derivative of a product of line 7 (i.e. left side of line 7)

9. Integration-by-parts since we have a variable \(\displaystyle x\) being a product of another function \(\displaystyle e^{2ln(x)}\)

\(\displaystyle u=e^{2ln(x)}\)\(\displaystyle dv=xdx\)
\(\displaystyle du=2xdx\)\(\displaystyle v=\dfrac{1}{2}x^2\)




10. \(\displaystyle \displaystyle ye^{2ln(x)}=\dfrac{1}{2}x^2e^{2ln(x)}-\int x\cdot x^2dx\)

11. \(\displaystyle \displaystyle ye^{2ln(x)}=\dfrac{1}{2}x^2e^{2ln(x)}-\int x^3dx\) the right hand side: \(\displaystyle \displaystyle uv-\int vdu\) take the integral \(\displaystyle x^3\)

12. \(\displaystyle \displaystyle ye^{2ln(x)}=\dfrac{1}{2}x^2e^{2ln(x)}-\dfrac{1}{4}x^4+C\)

13. \(\displaystyle \dfrac{ye^{2ln(x)}}{e^{2ln(x)}}=\dfrac{\dfrac{1}{2}x^2e^{2ln(x)}-\dfrac{1}{4}x^4+C}{e^{2ln(x)}}\) divide through to get y alone

14. \(\displaystyle y=\dfrac{4C+x^4}{4x^2}\)

 
Well, while the way you've done is almost correct except for one minor division error at the very end, there's a far far easier way than doing integration by parts. Note that \(\displaystyle e^{2ln(x)}=\left( e^{ln(x)} \right)^2=x^2\), and everything pretty much instantly falls into place.

\(\displaystyle \displaystyle \frac{d}{dx} yx^2 = \int x^3 \: dx\)

\(\displaystyle yx^2 = \frac{1}{4}x^4 + C\)

And this is where you made your error. Divide by x2:

\(\displaystyle \displaystyle y = \frac{\frac{1}{4}x^4 + C}{x^2}\)

\(\displaystyle \displaystyle y = \frac{x^4 + C}{4x^2}\)

Picking up from your method yields the same answer:

\(\displaystyle \displaystyle ye^{2ln(x)} = \frac{1}{2}x^2e^{2ln(x)} - \frac{1}{4}x^4 + C\)

\(\displaystyle \displaystyle yx^2 = \frac{1}{2}x^4 - \frac{1}{4}x^4 + C\)

\(\displaystyle \displaystyle yx^2 = \frac{1}{4}x^4 + C\)

\(\displaystyle \displaystyle y = \frac{x^4 + C}{4x^2}\)
 
I'm confused as to where the \(\displaystyle x^2\) came from on the left-hand side?
 
I'm confused as to where the \(\displaystyle x^2\) came from on the left-hand side?

You should know that:

\(\displaystyle \displaystyle{e^{2ln(x)} \ = \ x^2}\)

because:

\(\displaystyle \displaystyle{e^{ln(x)} \ = \ x}\)
 
Top