# Solving Differential Equations: Steps & Solutions

You might want to start with problem 1 and carefully work through that one.I am going to leave this thread now because it is getting too confusing. Try one problem, and if you still have difficulty, start a new thread.

## Homework Statement

Problem statement: Find the solution to the differential equation.

1) dy/dx= x^3-2y/x solution is: y= c/x^2 + x^3/5 the equation is linear but i do not know the steps.

The same goes for the following:

2. (x+y)dx - (x-y)dy=0 Solution is: arctan(y/x) - ln (square root of)x^2+y^2=c

6. xdy/dx +xy=1-y y(1)=0 solution is: y= x^-1(1-e^1-x)

8. xdy/dx +2y= sinx/x y(2)=1 solution is: (4+cos2-cosx)/x^2

12. dy/dx +y = 1/1+e^x solution is: y= ce^-x + e^-xln(1+e^x)

15. (e^x +1)dy/dx= y-ye^x solution is: y= c/cosh^2(x/2)

17. dy/dx= e^2x + 3y solution is: y= ce^3x-e^2x

20. y= e^x+y solution is: e^x + e^-y=c

22. dy/dx= x^2-1/y^2+1 y(-1)=1 solution is: y^3+3y-x^3+3x=2

30. dy/dx= y^3/1-2xy^2 y(0)=1 solution is: xy^2 -ln[y]=0

31. (x^2y+xy-y)dx + (x^2y-2x^2)dy=0 solution is:[x+ln[x]+x^-1+y-2ln[y]=c

Please show me how you solve these problems. I know that 15,20,22,&31 are separable. The rest are linear except for 2, its homogeneous.

## The Attempt at a Solution

For linear equations I am to find the integrating factor which is e to the power of the coefficient of y mulitplied by t. (e^xt) Then I multiply this factor with the equation and integrate to find the value of y. For seperable I am supposed to split the equation with x on one side and y on the other then integrate to find y. I tried doing that but could not figure out how to get the solutions that my professors gave me. Any help please?

Pick one or two problems and show us what you have tried, and we'll take it from there. I can't speak for everyone on this forum, but I'm not particularly excited about doing 10 or 11 problems for you.

Ok, for problem 1, I re-arranged the equation so that dy/dx -2y = x\2 then I found that the integrating factor is e^-2t since -2 is the coefficient of y. Then I integrate that but i do not know how the Dr. came up with the solution that he got because I got something different.

This is the correct solution: y= c/x^2 + x^3/5

For number 22, I got (y^2 +1)dy= (x^2-1)dx
then, (y^3/3) +y= (x^3/3) -x
then (y^3/3) +y -(x^3/3)+x
then multiply all that by 3

y^3 +3y -x^3+3x=0 boundary conditions are y(-1)= 1

so I replaced y with -1 in the equation and x with 1 and that way I would get c. But c did not equal 2, why is that? Please help

For 17 integrating factor is e^-3t so I re-arrange the equation and multiply it by e^-3t. I got
dy/dx e^-3t - 3ye^-3t= e^2x-3t

Then I integrate it, but how do you get y= ce^3x-e^2x by integration?

Ok, for problem 1, I re-arranged the equation so that dy/dx -2y = x\2 then I found that the integrating factor is e^-2t since -2 is the coefficient of y.
How did you get dy/dx - 2y = x/2 starting from dy/dx = x3 - 2y/x?

If you rearrange the equation to get all the y and dy/dx terms on one side, you get this:
dy/dx + 2y/x = x3

If I'm not mistaken, the integrating factor is 2ln(x). If you multiply both sides of the equation by this integrating factor, what you have on the left is the derivative of y*2ln(x), so when you integrate it, you get y*2ln(x).

For 17 integrating factor is e^-3t so I re-arrange the equation and multiply it by e^-3t. I got
dy/dx e^-3t - 3ye^-3t= e^2x-3t

Then I integrate it, but how do you get y= ce^3x-e^2x by integration?

You have too many variables, with y, x, and t. You should have just two variables, y and x, since the original problem is given in terms of y and x. With that change, your integrating factor is e-3x.

Then, the left side should look like dy/dx * e-3x - 3y e-3x, which happens to be the derivative with respect to x of ye-3x. If you integrate the derivative of ye-3x, you get ye-3x (plus a constant, but you can take care of that on the other side of the equation).

So, what you have is ye-3x = $\int e^{2x}e^{-3x} dx$. Simplify the integrand on the right before integrating. After you have done the integration, solve for y. That's the solution you're trying to find.

For problem 1 I divided by x so x^3 divided by x was x^2 but Im not sure if that is correct. The final answer should be y= c/x^2 + x^3/5 but I do not know how that was given. Can you show me?

For problem 1 I divided by x so x^3 divided by x was x^2 but Im not sure if that is correct. The final answer should be y= c/x^2 + x^3/5 but I do not know how that was given. Can you show me?

I am sure that that is NOT correct. The equation you started with is dy/dx= x^3-2y/x. Rearranging this gives dy/dx + 2y/x = x^3. If you divide both sides of the equation by x, you do get x^2 on the right, but you get a mess on the left side that is not help.

Don't worry so much about what the final answer is: worry instead about understanding how to solve these problems. As I said in post 6, I think the integrating factor is 2ln(x), ln(x^2) (they are the same, if x > 0).

Multiply both sides of your initial equation by the integrating factor. Read what I wrote in post 7. The technique in problem 1 and problem 17 is the same.

yes I know both are linear equations. But, can someone please give me a clear step-by-step on how to do it? I showed you what my method and answer was but couldnt get it to be the same as the correct answer.

What part of these don't you understand?
For problem 17:
You should have just two variables, y and x, since the original problem is given in terms of y and x. With that change, your integrating factor is e-3x.

Then, the left side should look like dy/dx * e-3x- 3ye-3x, which happens to be the derivative with respect to x of ye-3x. If you integrate the derivative of ye-3x, you get ye-3x(plus a constant, but you can take care of that on the other side of the equation).

So, what you have is ye-3x = $\int e^{2x}e^{-3x} dx$
. Simplify the integrand on the right before integrating. After you have done the integration, solve for y. That's the solution you're trying to find.

For problem 1:
As I said in post 6, I think the integrating factor is 2ln(x), ln(x^2) (they are the same, if x > 0).

Multiply both sides of your initial equation by the integrating factor. Read what I wrote in post 7. The technique in problem 1 and problem 17 is the same.

The title of the thread you started is "I need the steps." I am giving you a broad outline of how to get the solutions to a couple of these problems. Now it's up to you to take the steps I've outlined.

For problem 1. I re-arranged and got y(x) +2y = x^3. Thus, the integrating factor is e^2x, is that correct? Now, I multiply by e^2x and continue, correct? Or is this method wrong?

For problem 1. I re-arranged and got y(x) +2y = x^3. Thus, the integrating factor is e^2x, is that correct? Now, I multiply by e^2x and continue, correct? Or is this method wrong?

Here's what you started with:
dy/dx= x^3-2y/x

How do you get dy/dx + 2y = x^3 from that? If you add 2y/x to both sides, you get dy/dx + 2y/x = x^3

If you then multiply by x on both sides, you get
xdy/dx + 2y = x^4, not dy/dx + 2y = x^3.

you multiply both sides by x and then move 2y to the other side.

And then you get xdy/dx + 2y = x^4, not dy/dx + 2y = x^3, as you show. I have told you what the integrating factor for problem 1 is in posts 6, 9, and 11. The difficulties you are having finding the integrating factors seems to be from a weakness in some pretty basic algebra, so unless I'm wrong, you're going to have a real tough time completing one of these problems, let alone all of them.

sorry I missed that, now I multiply all that by e^2. After that, I integrate again right?

sorry I missed that, now I multiply all that by e^2. After that, I integrate again right?

NO, NO, NO! The integrating factor is NOT e2x!

why not? Is it e^integral 2x or e^x^2/2 ?

why not? Is it e^integral 2x or e^x^2/2 ?
Yes, it is e^integral 2x. That is not e^(x^2/2).

Because you don't have a differential equation of the form y' + p(x)y = q(x), that's why not.

What you have is xy' + 2y = x^4.

What do you need to do to get this equation to look like y' + p(x)y = q(x)?

divide by x to get rid of the xy. Si it becomes y + 2y/x= x^3

HallsofIvy said:
Yes, it is e^integral 2x. That is not e^(x^2/2).

This is incorrect, and the integrating factor I have stated in several posts in this thread is incorrect, also. The integrating factor is $$e^{\int \frac{2dx}{x}} = e^{2 ln(x)} = e^{ln(x^2)} = x^2.$$

divide by x to get rid of the xy. Si it becomes y + 2y/x= x^3

Yes. Now multiply both sides by the integrating factor (x^2). On the left side you have
y' x2 + 2y/x * x2, and on the right side you have x5

The left side should be recognizable as the derivative of some product. In other words,
y' x2 + 2y/x * x2 = d/dx(??).

If you integrate this derivative, the left side will be whatever is represented by ??. Integrate the right side as well, and then solve algebraically for y.

is that product 2x?

Ok, for problem 6, I got dy/dx + 2y/x = 1/x by re-arranging and dividing by x. Since 2y/x is the coefficient then the integrating factor is the same as before x^2.

multiply all sides by x^2 I get, dy/dx(x^2)+ 2xy = x, next we integrate so

x^3/3+c = x^2/2 but how do I get the answer I provided in the beginning with this result?

For problem 8 I got dy/dx + 2xy= sinx the integrating factor here is e^x^2/2. So then I mulitply the whole equation by that.

dy/dx(e^x^2/2) + 2xy(e^x^2/2)= sinx(e^x^2/2)
Can you please explain to me in detail how I would integrate this, this is where I am having the most trouble.

For problem 20 I multiplied both sides by dx to get dy= e^x+y (dx)
so by integrating i get y+c= integral of e^x+y (dx)
Can you please show me how to integrate the right side. I am having trouble integrating es

For 31 i re-arranged and got dy/dx= ((x^2)y +xy-y)/(-(x^2)y +2x^2). from here (x^2)/y cancel out. and Im left with xy-y(dx)= 2x^2(dy). You can then divide by x and you are left with 1/2x(dx) = y+c by integrating the y side. but that is not correct what's my mistake? I have no clue how I can solve problem 30. But I have attempted to solve all so I would appreciate anyones help.

Last edited:
is that product 2x?
Not unless d/dx(2x) = y'x2 + 2xy. (It isn't.)

Think product rule.

Last edited:
the product rule states (f.g) = f.g + f.g`

so is it? (y+2x)+ (x^2)

Ok, for problem 6, I got dy/dx + 2y/x = 1/x by re-arranging and dividing by x. Since 2y/x is the coefficient then the integrating factor is the same as before x^2.

multiply all sides by x^2 I get, dy/dx(x^2)+ 2xy = x, next we integrate so

x^3/3+c = x^2/2 but how do I get the answer I provided in the beginning with this result?

If you integrate y'x2 + 2xy, you don't get x3, either with or without a constant.

Let's look at a different example, and work it through. Hopefully you will follow what's going on and be able to apply it to your problems.

Problem: Solve y' -4y = 12

This DE is linear, so we can solve it by using an integrating factor. In this case, the integrating factor is
$$e^{\int -4 dx} = e^{-4x}$$
Multiply both sides of the equation by the integrating factor, getting
y'e-4x -4ye-4x = 12e-4x

The two terms on the left side are the derivative of ye-4x, which you can check by using the product rule. In other words, d/dx(ye-4x) = y'e-4x -4ye-4x.
The whole purpose of the business of an integrating factor is to multiply y' +p(x)y by whatever it takes so that it becomes the derivative of something.

We're now ready to integrate both sides.

$$\int (y'e^{-4x} -4ye^{-4x})dx = \int 12e^{-4x} dx$$

The left side can be simplified, by replacing the integrand with something equal to it, and integrating the right side.
$$\int d/dx(ye^{-4x})dx = -3e^{-4x} + C$$

Then, since the integral of the derivative of something is just the something, we have
ye-4x = -3e-4x + C

If we solve for y by multiplying both sides by e4x, we get
y = -3 + Ce4x, the solution to our DE. It's easy to check that this is the solution.

thx a lot mark but one last favor, can u please show me how u checked using the product rule?

Sure.
d/dx(ye-4x) = y'e-4x + y*(-4 e-4x) = y'e-4x - 4xye-4x.

So y'e-4x - 4xye-4x is the derivative, with respect to x, of ye-4x