# Solving the DE

roam
Hello!

Here's a question I was doing but I'm not sure if I'm right...

It says "solve" the following differential equation:
$$(x^2 +1) \frac{dy}{dx} = 0$$

So, this is what I've done:

We put it in form $$\frac{dy}{dx} +p(x)y = q(x)$$

Then we divide it by x^2 +1 to obtain:
$$\frac{dy}{dx} + \frac{x}{x^2 +1} y = \frac{1}{x^2 +1} \times 0$$

you know , in standard form where p(x) = x/x^2 +1

Integrating factor is:
$$exp[\int p(x) dx = exp[\frac{x dx}{x^2 +1}$$
$$= exp[ln(x^2 +1)^{2}]$$
$$= (x^2 +1)^{2}$$

Multiplying the DE by the integrating factor;
$$(x^2 +1)^{2} \frac{dy}{dx} +x(x^2 +1)y = x . (x^2 +1)^{2}$$

Now we integrate:
$$\frac{d}{dx} [(x^2 +1)^{2} y] = x^3 +x$$

=> $$[(x^2 +1)^{2} y] = \frac{x^4}{4} + \frac{x^2}{2} + c$$

Am I right? Please correct me if I'm wrong...

Thank you,

Vid
The only answer is y = c.

You have two things being multiplied together equaling zero. This means that either (x^2+1) = 0 or dy/dx = 0. In the first case, the equation is only true when x = +-i which isn't very useful since we solve DEs over an interval and would also allow for y to be any function of x (again not very useful). In the second case, dy/dx = 0 thus y = c is the only solution.

You can see your solution doesn't work by just plugging it into the original equation.

roam
Yes, maybe but could you please show me how the actual calculation goes till we get to y = c? Thank you.

Last edited:
Vid
dy/dx = 0 from my explanation above. The only (continuous) functions with zero derivatives are constant functions.

roam
$$(x^2 +1) \frac{dy}{dx} = 0$$

The correct answer at the back of the book is $$y = \frac{c}{\sqrt{x^2 +1}}$$.

I get your explanation, Vid. But the question is asking me to show working and calculations.

Last edited:
Homework Helper
$$(x^2 +1) \frac{dy}{dx} = 0$$

The correct answer at the back of the book is $$y = \frac{c}{\sqrt{x^2 +1}}$$.

I get your explanation, Vid. But the question is asking me to show working and calculations.

No, you haven't understood what he is saying. Vid is trying to tell you is that, since x2+ 1 is never 0, you can divide on both sides by it to get dy/dx= 0 which, integrating, gives y= c, a constant. That should be pretty simple mathematics.
$y(x)= c\sqrt{x^2+1}$ satisfies the equation $(x^2+1)dy/dx= xy$, not 0.

roam
Yes, Thanks. 2) Solve: $$\frac{dy}{dx} + 2xy = x$$

This is what I think;

$$\int 2x dx = x^2$$

So we multiply both sides by $$e^{x^2}$$

$$\frac{d}{dx} (e^{x^2} y) = xe^{x^2}$$

$$e^{x^2}y = \frac{1}{2}e^{x^2} + c$$

=> $$y = c e^{x^2} - \frac{1}{2}$$

c is a constant.

I appreciate that if you could tell me if I made any errors or mistakes..

Last edited:
Homework Helper
$$e^{x^2}y = \frac{1}{2}e^{x^2} + c$$
It's correct up to here.

=> $$y = c e^{x^2} - \frac{1}{2}$$
This is incorrect. You were dividing the RHS by $$e^{x^2}$$ right? You should get $$\frac{1}{2} + ce^{-x^2}$$ instead.

roam
$$\frac{1}{2} + ce^{-x^2}$$ or $$\frac{1}{2} + ce^{x^2}$$?

Anyway, Thanks a lot for your attention!

Homework Helper
It's the first one. That is what you get when you divide c by $$e^{x^2}$$

roam
Of course!
Many thanks...

roam
For the first question, if the question was: $$(x^2 +1) \frac{dy}{dx} +xy = 0$$
then the solution would be: $$y = \frac{c}{\sqrt{x^2 +1}}$$

Hmm, so how do we get that? (that was my question but I missed out +xy).

Does any of my working in the very above post make any sense?

I don't know how do this question so I get $$y = \frac{c}{\sqrt{x^2 +1}}$$ ...

Last edited:
Homework Helper
What's the integrating factor in this case? Remember you must first express the DE in the form: $$\frac{dy}{dx} + P(x)y = Q(x)$$

Homework Helper
Yes, Thanks. 2) Solve: $$\frac{dy}{dx} + 2xy = x$$
So $$\frac{dy}{dx}= x- 2xy= x(1- 2y)[/itex] [tex]\frac{dy}{1- 2y}= xdx[/itex] This is what I think; [tex]\int 2x dx = x^2$$

So we multiply both sides by $$e^{x^2}$$

$$\frac{d}{dx} (e^{x^2} y) = xe^{x^2}$$

$$e^{x^2}y = \frac{1}{2}e^{x^2} + c$$

=> $$y = c e^{x^2} - \frac{1}{2}$$

c is a constant.

I appreciate that if you could tell me if I made any errors or mistakes..

roam
What's the integrating factor in this case? Remember you must first express the DE in the form: $$\frac{dy}{dx} + P(x)y = Q(x)$$

Yes I did put it in the standard form and I found the integrating factor

$$(x^2 +1) \frac{dy}{dx} +xy = 0$$

standard form : $$\frac{dy}{dx} +p(x)y = q(x)$$

Then we divide it by x^2 +1 to obtain:
$$\frac{dy}{dx} + \frac{x}{x^2 +1} y = \frac{1}{x^2 +1} \times 0$$

Integrating factor is:
$$exp[\int p(x) dx = exp[\frac{x dx}{x^2 +1}$$

$$= exp[ln(x^2 +1)^{2}]$$
$$= (x^2 +1)^{2}$$

multiplying it by the integrating factor;
$$(x^2 +1)^{2} \frac{dy}{dx} +x(x^2 +1)y = x . (x^2 +1)^{2}$$

Now we integrate: $$\frac{d}{dx} [(x^2 +1)^{2} y] = x^3 +x$$

I get: $$[(x^2 +1)^{2} y] = \frac{x^4}{4} + \frac{x^2}{2} + c$$

But this is wrong since the correct answer should be: $$y = \frac{c}{\sqrt{x^2 +1}}$$

I don't know how to get that. Vid
Int(x/(x^2+1) = 1/2ln(x^2+1) = ln|(x^2+1)^(1/2)| not squared. The right side is just zero so the integral is just c; solve for y to get the right answer. Also this DE is easier as a separable equation instead of a first order linear.

Last edited:
$$(x^2 +1) \frac{dy}{dx} +xy = 0$$
Subtractiong xy from both sides and dividing on both sides by $x^2+ 1$
$$frac{dy}{dx}= \frac{xy}{x^2+ 1}= \right(\frac{x}{x^2+1}\right) y$$
$$ydy= \frac{x dx}{x^2+1}$$