First order differential equation with step function

Watch this thread
E--
Badges: 7
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#1
Report Thread starter 3 years ago
#1
Solve the D.E:
 3(x^2+7) \frac{dy(x)}{dx}  + 2xy(x) = f(x)

\where f(x) =

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

satisfying the condition y(1) = 0

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

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

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

Non-homogenous equation i got
y(x) = \frac{3}{2}  + 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?
Last edited by E--; 3 years ago
0
reply
mqb2766
Badges: 19
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#2
Report 3 years ago
#2
The first one. The constant will be a multiplier.
(Original post by E--)
Solve the D.E:
 3(x^2+7) \frac{dy(x)}{dx}  + 2xy(x) = f(x)

\where f(x) =

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

satisfying the condition y(1) = 0

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

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

Would this simplify to \ A(x^2+7)^{-1/3} or \ (x^2+7)^{-1/3} + C ?
0
reply
E--
Badges: 7
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#3
Report Thread starter 3 years ago
#3
(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?
0
reply
mqb2766
Badges: 19
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#4
Report 3 years ago
#4
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?
Last edited by mqb2766; 3 years ago
0
reply
E--
Badges: 7
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#5
Report Thread starter 2 years ago
#5
(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(x^2+7)^{-1/3} For x>1 using the initial condition (y(1)=0), I get

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

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

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

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

(3) For x < 0, where do I calculate y(0)? Do you mean calculate \ A(x^2+7)^{-1/3} = \frac{1}{2} - (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?
Last edited by E--; 2 years ago
0
reply
mqb2766
Badges: 19
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#6
Report 2 years ago
#6
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(x^2+7)^{-1/3} For x>1 using the initial condition (y(1)=0), I get

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

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

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

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

(3) For x < 0, where do I calculate y(0)? Do you mean calculate \ A(x^2+7)^{-1/3} = \frac{1}{2} - (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?
0
reply
E--
Badges: 7
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#7
Report Thread starter 2 years ago
#7
(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"
0
reply
mqb2766
Badges: 19
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#8
Report 2 years ago
#8
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"
0
reply
E--
Badges: 7
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#9
Report Thread starter 2 years ago
#9
(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(x^2+7)^{-1/3}

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

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

With initial conditions:

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

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

y1(0) = y2(0)

\ C1 = \frac{7^{1/3}}{2}\ - 1
Last edited by E--; 2 years ago
0
reply
mqb2766
Badges: 19
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#10
Report 2 years ago
#10
Solving the two differential equations on x in [0,inf) gives
\ y_3(x) = 0
\ y_2(x) = 1/2 -1/(x^2+7)^{1/3}
gives
\ y_2(0) = 1/2 - 1/7^{1/3}
so we must have
\ y_1(0) = 1/2-1/7^{1/3}
so
\ C1 = 7^{1/3}/2 - 1
and on x<0
\ 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(x^2+7)^{-1/3}

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

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

With initial conditions:

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

D3: y(1) = 0 \ y = 0
Last edited by mqb2766; 2 years ago
0
reply
E--
Badges: 7
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#11
Report Thread starter 2 years ago
#11
(Original post by mqb2766)
Solving the two differential equations on x in [0,inf) gives
\ y_3(x) = 0
\ y_2(x) = 1/2 -1/(x^2+7)^{1/3}
gives
\ y_2(0) = 1/2 - 1/7^{1/3}
so we must have
\ y_1(0) = 1/2-1/7^{1/3}
so
\ C1 = 7^{1/3}/2 - 1
and on x<0
\ 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 ?
Last edited by E--; 2 years ago
1
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

How did your Edexcel A-level Economics Paper 1 go?

Loved the paper - Feeling positive (51)
15.74%
The paper was reasonable (163)
50.31%
Not feeling great about that exam... (79)
24.38%
It was TERRIBLE (31)
9.57%

Watched Threads

View All