Linear ode; how does answer key get this?

  • MHB
  • Thread starter find_the_fun
  • Start date
  • Tags
    Linear Ode
In summary, the conversation is about solving a linear equation involving a differential equation and rewriting it in a different form. The original equation is x(dy/dx) - y = x^2sinx and it is rewritten as dy/dx - y/x = x^2sinx/x = xsinx. The solution involves finding the integral of -1/x and using the rule for ylnx=lnx^y. The final solution is y=cx-xcosx where c is a constant that can take any real value. The domain of the solution is all of R and it satisfies the original ODE for all values of x, including x=0.
  • #1
find_the_fun
148
0
Solve the linear equation:

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

-Dan
 
  • #3
topsquark said:
Check your integral again. \(\displaystyle e^{\int -\frac{1}{x}~dx} = -x\)

-Dan

Erm...
$$e^{\int -\frac{1}{x}~dx} = e^{-\ln x+c_1}=e^{\ln(1/x)+c_1}=\frac{c_2}{x}$$
 
  • #4
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$?
 
  • #5
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}$$
 
  • #6
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.
\(\displaystyle \int -\frac{1}{x}~dx = -ln|x| + C\)

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

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.
 

FAQ: Linear ode; how does answer key get this?

How do you solve a linear ODE?

To solve a linear ODE, you can use different methods such as separation of variables, integrating factors, or variation of parameters. You will need to rewrite the ODE into its standard form and then apply the appropriate method.

What is the difference between a linear and a non-linear ODE?

A linear ODE is a type of differential equation where the dependent variable and its derivatives appear in a linear form. On the other hand, a non-linear ODE has non-linear terms such as powers or products of the dependent variable and its derivatives.

Why is the answer key necessary for solving a linear ODE?

The answer key provides a solution to the linear ODE and helps to check the accuracy of your own solution. It can also serve as a guide for beginners learning how to solve linear ODEs.

How do you know if a solution to a linear ODE is correct?

You can check the validity of a solution to a linear ODE by substituting it back into the original equation and verifying if it satisfies the equation. Additionally, you can also check if it satisfies any initial or boundary conditions given in the problem.

Can a linear ODE have more than one solution?

Yes, a linear ODE can have more than one solution. This is because the general solution to a linear ODE will contain arbitrary constants, and different values of these constants can lead to different solutions. However, if additional conditions are given, the solution can be uniquely determined.

Back
Top