MHB Linear ode; how does answer key get this?

  • Thread starter Thread starter find_the_fun
  • Start date Start date
  • Tags Tags
    Linear Ode
find_the_fun
Messages
147
Reaction score
0
Solve the linear equation:

[math]x\frac{dy}{dx}-y=x^2sinx[/math]
rewrite [math]\frac{dy}{dx}-\frac{y}{x}=\frac{x^2sinx}{x}=xsinx[/math]
[math]P(x)=\frac{-1}{x}[/math]
So [math]e^ { \int \frac{-1}{x} dx }=-1[/math]<=this is where I went wrong
[math]\frac{d}{dx}[-y]=-xsinx[/math]
[math]\int -x sin(x)=xcosx-sinx +C[/math] but the answer key gives [math]y=cx-xcosx[/math]
 
Last edited:
Physics news on Phys.org
find_the_fun said:
[math]P(x)=\frac{-1}{x}[/math]
So [math]e^ { \int \frac{-1}{x} dx }=-1[/math]
Check your integral again. [math]e^{\int -\frac{1}{x}~dx} = -x[/math]

-Dan
 
topsquark said:
Check your integral again. [math]e^{\int -\frac{1}{x}~dx} = -x[/math]

-Dan

Erm...
$$e^{\int -\frac{1}{x}~dx} = e^{-\ln x+c_1}=e^{\ln(1/x)+c_1}=\frac{c_2}{x}$$
 
I like Serena said:
Erm...
$$e^{\int -\frac{1}{x}~dx} = e^{-\ln x+c_1}=e^{\ln(1/x)+c_1}=\frac{c_2}{x}$$

Ok I'm still stuck but I may know why. Isn't $e^{-lnx}=-x$?
 
find_the_fun said:
Ok I'm still stuck but I may know why. Isn't $e^{-lnx}=-x$?

Because when we apply the rule $y\ln x=\ln x^y$, we get:
$$e^{-\ln x}=e^{-1 \cdot \ln x}
=e^{\ln x^{-1}}=e^{\ln (1/x)}=\frac{1}{x}$$
 
find_the_fun said:
Ok I'm still stuck but I may know why. Isn't $e^{-lnx}=-x$?
Sort of. As I like Serena pointed out I was ignoring the arbitrary constant in the integration.
[math]\int -\frac{1}{x}~dx = -ln|x| + C[/math]

-Dan
 
I finally get it now :) One more question, why is the interval [math](0, \infty)[/math]? Is it because it because x can't be 0 because there's the intermediate step [math]\frac{d}{dx}[\frac{y}{x}][/math]?
 
find_the_fun said:
I finally get it now :) One more question, why is the interval [math](0, \infty)[/math]? Is it because it because x can't be 0 because there's the intermediate step [math]\frac{d}{dx}[\frac{y}{x}][/math]?

Intermediate steps do not really count.
They can introduce new solutions, or "lose" solutions, such as in this case.
Ultimately, we have to check the solutions against the original equation and consider what should happen to all the solutions we inadvertently either introduced, or eliminated.

The domain of the solution is actually all of $\mathbb R$ and the constant $c$ can also take all real values.
We can tell by substituting the solution we found in the original equation.

The solution is:
$$y=cx-x\cos x \Rightarrow \d y x = c - \cos x + x\sin x$$
Substituting gives:
$$x\d yx - y = x(c - \cos x + x\sin x) - (cx-x\cos x) = x^2\sin x$$
So the solution satisfies the ODE for all values of $x$.
That is including $x=0$ for which the equation is well defined.
 
Back
Top