The Student Room Group

First order differential equation with step function

Solve the D.E:
3(x2+7) 3(x^2+7) dy(x)dx\frac{dy(x)}{dx} +2xy(x)=f(x) + 2xy(x) = f(x)


Unparseable latex formula:

\where f(x) =



0 0  x<0 \ x < 0
x x  0<x<1 \ 0 < x < 1
0 0  1<x \ 1 < x



satisfying the condition y(1) = 0

For the homogenous equation
3(x2+7) 3(x^2+7) dy(x)dx\frac{dy(x)}{dx} +2xy(x)=0 + 2xy(x) = 0

I got  y=e(1/3)In(x2+7)+c\ y = e^{(-1/3)In(x^2 + 7) + c}

Would this simplify to  A(x2+7)1/3\ A(x^2+7)^{-1/3} or  (x2+7)1/3+C?\ (x^2+7)^{-1/3} + C ?

Non-homogenous equation i got
y(x) = 32\frac{3}{2} +C(x2+7)(1/3) + C(x^2 + 7)^{(-1/3)}

I'm stuck here, do i put the initial value in the non homogeneous equation and then solve for x>1?
How do I check if my solution is correct?
(edited 4 years ago)
Reply 1
The first one. The constant will be a multiplier.
Original post by E--
Solve the D.E:
3(x2+7) 3(x^2+7) dy(x)dx\frac{dy(x)}{dx} +2xy(x)=f(x) + 2xy(x) = f(x)


Unparseable latex formula:

\where f(x) =



0 0  x<0 \ x < 0
x x  0<x<1 \ 0 < x < 1
0 0  1<x \ 1 < x



satisfying the condition y(1) = 0

For the homogenous equation
3(x2+7) 3(x^2+7) dy(x)dx\frac{dy(x)}{dx} +2xy(x)=0 + 2xy(x) = 0

I got  y=e(1/3)In(x2+7)+c\ y = e^{(-1/3)In(x^2 + 7) + c}

Would this simplify to  A(x2+7)1/3\ A(x^2+7)^{-1/3} or  (x2+7)1/3+C?\ (x^2+7)^{-1/3} + C ?
Reply 2
Original post by mqb2766
The first one. The constant will be a multiplier.

How would I solve the equation for 1<x? And when do I put in the values for the initial condition?
Reply 3
The 3/2 in the second solution in your OP doesn't look right.

As the right hand side is piecewise / has 3 different parts, you'd expect a piecewise (breakdown) solution for y(x). The initial conditions (joining values) should match across each of the two breaks, so that the overall solution would be continuous at y(0) and y(1). That still leaves one constant to determine which is y(1) = 0.

To solve for the y(x) where x>1, put the initial condition into the homogeneous equation and solve for A. It looks like a fairly trivial solution.
For 0<x<1, find the PI when the rhs is x, then again use the same initial condition y(1) = 0.
For x<0, use the homogeneous equation and solve for A (different A this time) using the value calculated at y(0).


Original post by E--
How would I solve the equation for 1<x? And when do I put in the values for the initial condition?
(edited 4 years ago)
Reply 4
Original post by mqb2766
The 3/2 in the second solution in your OP doesn't look right.

As the right hand side is piecewise / has 3 different parts, you'd expect a piecewise (breakdown) solution for y(x). The initial conditions (joining values) should match across each of the two breaks, so that the overall solution would be continuous at y(0) and y(1). That still leaves one constant to determine which is y(1) = 0.

To solve for the y(x) where x>1, put the initial condition into the homogeneous equation and solve for A. It looks like a fairly trivial solution.
For 0<x<1, find the PI when the rhs is x, then again use the same initial condition y(1) = 0.
For x<0, use the homogeneous equation and solve for A (different A this time) using the value calculated at y(0).

I'm still unsure but here is what I’ve got
(1) Solution to homogeneous equation  y=A(x2+7)1/3\ y = A(x^2+7)^{-1/3} For x>1 using the initial condition (y(1)=0), I get

 A=0\ A = 0 so  y(x)=0\ y(x) = 0

(2) Solution to non-homogeneous  y(x)\ y(x) = 12\frac{1}{2} +C(x2+7)(1/3) + C(x^2 + 7)^{(-1/3)}

Using the same initial condition (y(1) = 0) I get  C=1\ C = -1

so  y(x)\ y(x) = 12\frac{1}{2} (x2+7)(1/3) - (x^2 + 7)^{(-1/3)}

(3) For x < 0, where do I calculate y(0)? Do you mean calculate  A(x2+7)1/3=\ A(x^2+7)^{-1/3} = 12\frac{1}{2}(x2+7)(1/3) - (x^2 + 7)^{(-1/3)}
at x = 0?

Also shouldn't it start from finding the solution for x < 0 then, 0<x<1 and then x>1?
(edited 4 years ago)
Reply 5
The homogeneous and non-homogeneous solutions seem right.

When dealing with differential equations like this, its easy to imagine there is some physical interpretation of x. There may be in reality, but not in the maths model. The easiest way to incorporate the "initial" condition is as you describe it and work along x in the negative direction. y(1) gives the "initial" condition for x>1 and the "final" condition for 0<x<1. y(0) would then be obtained from the non-homogeneous solution and matched to the "final" condition homogeneous solution for x<0.

If you worked forwards, you'd just end up with a combination (probably relatively easy to solve) of constants which would have to be solved. Easiest to work backwards here.

Original post by E--
I'm still unsure but here is what I’ve got
(1) Solution to homogeneous equation  y=A(x2+7)1/3\ y = A(x^2+7)^{-1/3} For x>1 using the initial condition (y(1)=0), I get

 A=0\ A = 0 so  y(x)=0\ y(x) = 0

(2) Solution to non-homogeneous  y(x)\ y(x) = 12\frac{1}{2} +C(x2+7)(1/3) + C(x^2 + 7)^{(-1/3)}

Using the same initial condition (y(1) = 0) I get  C=1\ C = -1

so  y(x)\ y(x) = 12\frac{1}{2} (x2+7)(1/3) - (x^2 + 7)^{(-1/3)}

(3) For x < 0, where do I calculate y(0)? Do you mean calculate  A(x2+7)1/3=\ A(x^2+7)^{-1/3} = 12\frac{1}{2}(x2+7)(1/3) - (x^2 + 7)^{(-1/3)}
at x = 0?

Also shouldn't it start from finding the solution for x < 0 then, 0<x<1 and then x>1?
Reply 6
Original post by mqb2766
The homogeneous and non-homogeneous solutions seem right.

When dealing with differential equations like this, its easy to imagine there is some physical interpretation of x. There may be in reality, but not in the maths model. The easiest way to incorporate the "initial" condition is as you describe it and work along x in the negative direction. y(1) gives the "initial" condition for x>1 and the "final" condition for 0<x<1. y(0) would then be obtained from the non-homogeneous solution and matched to the "final" condition homogeneous solution for x<0.

If you worked forwards, you'd just end up with a combination (probably relatively easy to solve) of constants which would have to be solved. Easiest to work backwards here.


If i do it in the order x < 0 then, 0<x<1 and then x>1: I get different answers but when I put them in the differential equation it works:
So for x < 0 i get y = 0, but if i work backwards i get y = 0 for x>1. So i don't know which one is right.

Here is what i did "Split the question into two domains 𝐷1= (−∞,0] [1,∞) and 𝐷2 = (0,1). When you have the general solution for the first half of 𝐷1 you use the initial condition (IC) to remove the constants of integration. Then you plug in the 𝑥 value for which the second domain starts. This value will be the IC for the solution of 𝐷2. Then you determine the constants of integration for the general solution on 𝐷2. Again plug in the 𝑥 value for which the second half of𝐷1 starts. This point will be the IC for the second half of 𝐷1. Use the general solution for the first part of 𝐷1 and determine the constant of integration"
Reply 7
Your differential equation has to be solved on 3 intervals and pieced together. The solution is unique whichever way you do it, so if there is a difference, there is an error.

D1: x<=0: solution is y1(x) with constant c1: homogeneous
D2: 0<=x<=1: solution is y2(x) with constant c2: non-homogeneous
D3: 1<=x: solution is y3(x) with constant c3: homogeneous

The given initial condition y(1) = 0 can be used for both y2(x) and y3(x) to determine c2 and c3. I think we agree on those values?
Then to calculate c1, set y1(0) = y2(0).

If you're unsure, can you post the y1, y2 and y3 and I'll check.


Original post by E--
If i do it in the order x < 0 then, 0<x<1 and then x>1: I get different answers but when I put them in the differential equation it works:
So for x < 0 i get y = 0, but if i work backwards i get y = 0 for x>1. So i don't know which one is right.

Here is what i did "Split the question into two domains 𝐷1= (−∞,0] [1,∞) and 𝐷2 = (0,1). When you have the general solution for the first half of 𝐷1 you use the initial condition (IC) to remove the constants of integration. Then you plug in the 𝑥 value for which the second domain starts. This value will be the IC for the solution of 𝐷2. Then you determine the constants of integration for the general solution on 𝐷2. Again plug in the 𝑥 value for which the second half of𝐷1 starts. This point will be the IC for the second half of 𝐷1. Use the general solution for the first part of 𝐷1 and determine the constant of integration"
Reply 8
Original post by mqb2766
Your differential equation has to be solved on 3 intervals and pieced together. The solution is unique whichever way you do it, so if there is a difference, there is an error.

D1: x<=0: solution is y1(x) with constant c1: homogeneous
D2: 0<=x<=1: solution is y2(x) with constant c2: non-homogeneous
D3: 1<=x: solution is y3(x) with constant c3: homogeneous

The given initial condition y(1) = 0 can be used for both y2(x) and y3(x) to determine c2 and c3. I think we agree on those values?
Then to calculate c1, set y1(0) = y2(0).

If you're unsure, can you post the y1, y2 and y3 and I'll check.

D1:  y=C1(x2+7)1/3\ y = C1(x^2+7)^{-1/3}

D2:  y(x)\ y(x) = 12\frac{1}{2} +C2(x2+7)(1/3) + C2(x^2 + 7)^{(-1/3)}

D3:  y=C3(x2+7)1/3\ y = C3(x^2+7)^{-1/3}

With initial conditions:

D2 y(1) = 0 :  y=\ y = 12\frac{1}{2} 1(x2+7)1/3\ -1(x^2+7)^{-1/3}

D3: y(1) = 0  y=0\ y = 0

y1(0) = y2(0)

 C1=\ C1 = 71/32\frac{7^{1/3}}{2} 1\ - 1
(edited 4 years ago)
Reply 9
Solving the two differential equations on x in [0,inf) gives
 y3(x)=0\ y_3(x) = 0
 y2(x)=1/21/(x2+7)1/3\ y_2(x) = 1/2 -1/(x^2+7)^{1/3}
gives
 y2(0)=1/21/71/3\ y_2(0) = 1/2 - 1/7^{1/3}
so we must have
 y1(0)=1/21/71/3\ y_1(0) = 1/2-1/7^{1/3}
so
 C1=71/3/21\ C1 = 7^{1/3}/2 - 1
and on x<0
 y1(x)=(71/3/21)/(x2+7)1/3\ y_1(x) = (7^{1/3}/2-1)/(x^2+7)^{1/3}
A bit messy I admit, but that's what the numbers give.
Original post by E--
D1:  y=C1(x2+7)1/3\ y = C1(x^2+7)^{-1/3}

D2:  y(x)\ y(x) = 12\frac{1}{2} +C2(x2+7)(1/3) + C2(x^2 + 7)^{(-1/3)}

D3:  y=C3(x2+7)1/3\ y = C3(x^2+7)^{-1/3}

With initial conditions:

D2 y(1) = 0 :  y=1(x2+7)1/3\ y = -1(x^2+7)^{-1/3}

D3: y(1) = 0  y=0\ y = 0
(edited 4 years ago)
Reply 10
Original post by mqb2766
Solving the two differential equations on x in [0,inf) gives
 y3(x)=0\ y_3(x) = 0
 y2(x)=1/21/(x2+7)1/3\ y_2(x) = 1/2 -1/(x^2+7)^{1/3}
gives
 y2(0)=1/21/71/3\ y_2(0) = 1/2 - 1/7^{1/3}
so we must have
 y1(0)=1/21/71/3\ y_1(0) = 1/2-1/7^{1/3}
so
 C1=71/3/21\ C1 = 7^{1/3}/2 - 1
and on x<0
 y1(x)=(71/3/21)/(x2+7)1/3\ y_1(x) = (7^{1/3}/2-1)/(x^2+7)^{1/3}
A bit messy I admit, but that's what the numbers give.

Yes, I got this. Thank you.
Btw would this work for 2nd order D.E ?
(edited 4 years ago)

Quick Reply

Latest