How to Solve Exact Differential Equations with Discontinuous Functions?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 3K views
mehtamonica
Messages
26
Reaction score
0
i have to solve the following differential equation :

dy/ dx + y = f(x) where f (x) = 2, 0 <= x < 1 and 0 if x >=1

and y (0)=0.

please explain how to solve it as it involves a discontinuous function ?

I am stuck while computing after computing the integrating factor e^x. Please suggest how to proceed beyond this.
 
Last edited:
Physics news on Phys.org
Yes, the integrating factor is [itex]e^x[/itex]. Multiplying both side of the equation by [itex]e^x[/itex] you have
[tex]e^x\frac{dy}{dx}+ e^xy= e^xf(x)[/tex]
[tex]\frac{d(e^xy)}{dx}= e^xf(x)[/tex]
Integrate both sides to get
[tex]e^x y(x)= \int_0^x tf(t)dt[/tex]
(I chose the lower limit of integration to be 0 because the integral of any function from 0 to 0 so that gives y(0)= 0.)

I suspect it is that integration that is bothering you. Take it "step by step".

For [itex]0\le x\le 1[/itex] f(x)= 2 so [itex]e^xf(x)= 2e^x[/itex] on that interval.
[itex]\int_0^x 2e^t dt= 2(e^x- e^0)= 2(e^x- 1)[/itex]
Of course, for that, if x= 1, [itex]2(e- 1)[/itex]

For x> 1, f(x)= 0 so [itex]e^x f(x)= 0[/itex]. [itex]\int_1^x 0 dx= 0[/itex] so [itex]\int_0^x e^xf(x)dx= 2(e- 1)[/itex].

That is, the integral is [itex]2(e^x-1)[/itex] for [itex]0\le x\le 1[/itex] and the constant [itex]2(e- 1)[/itex] for [itex]x\ge 1[/itex].
 
Thank a lot for this guidance, but i still have a doubt and hope that you may help me out this time as well. when f(x)=0 for x>=1 then how do we substitute x=1 in the solution obtained for 0<=x<1? please enlighten me on this