Linear ordinary differential equation.

  • Thread starter Buffu
  • Start date
  • Tags
    ode
  • #1
850
146

Homework Statement



##\dfrac{dy}{dx} + y = f(x)##

##f(x) = \begin{cases} 2 \qquad x \in [0, 1) \\ 0 \qquad x \ge 1 \end{cases}##

##y(0) = 0##

Homework Equations




The Attempt at a Solution



Integrating factor is ##e^x##

##e^x\dfrac{dy}{dx} + e^x y = e^x f(x)##

##\displaystyle ye^x = \int e^x f(x) dx = \begin{cases} \int 2e^x dx = 2e^x + C \qquad x \in [0, 1) \\ \int 0 dx = C^\prime \qquad x \ge 1 \end{cases}##


Solving for inital value,

##ye^x = \begin{cases} 2(e^x - 1) \qquad x \in [0, 1) \\ 0 \qquad x \ge 1 \end{cases}##

The answer is ##ye^x = \begin{cases} 2(e^x - 1) \qquad x \in [0, 1) \\ 2(e - 1) \qquad x \ge 1 \end{cases}##
, which is way off.

I think the fault is in my answer this time but I can't point it :(.
 

Answers and Replies

  • #2
Charles Link
Homework Helper
Insights Author
Gold Member
2020 Award
5,060
2,354
From your first solution ## y(1)=2(1-e^{-1} ) ##. (We're going to assume that ## y ## is continuous at ## x=1 ##). From the second solution ## y \, e^x=C' ## . But ## C'=y(1) e^1 ##. Thereby ## y e^x=2(e-1) ## for ## x>1 ##.
 
  • #3
epenguin
Homework Helper
Gold Member
3,864
895
Finding in integration factor seems over-engineering. You could just as well treated as two differential equations, both very simple:

y' = -y and y' = - ( y - 2 ) .

The arbitrary constant for the solution of the second is in principle arbitrary, but it would be natural to treat it as given by a requirement of continuity as already mentioned.
 
  • #4
Charles Link
Homework Helper
Insights Author
Gold Member
2020 Award
5,060
2,354
One question/comment for @Buffu is how do you know that the homogeneous solution ## y=A \, e^{-x} ## doesn't play a role in the solution? That is apparently an underlying assumption in the problem (that you ignore any homogeneous solution), but it is always good practice to consider the possibility of a homogeneous solution. ## \\ ## Editing: In the solution for ## x>1 ##, the solution is in fact the homogeneous solution. Also, for ## 0<x<1 ##, the integrating factor method you used actually generated a homogeneous solution. ## \\ ## Let me offer an alternative solution to the differential equation above: For ## 0<x<1 ##, ## y_p=2 ## and the homogeneous solution is ## y_h=A \, e^{-x} ##, so that for ## 0<x<1 ## , ## y=2+A \, e^{-x} ## for some ## A ## . ## \\ ## For ## x>1 ##, ## y_p=0 ##, and ## y_h=B \, e^{-x} ##, so that ## y=B \, e^{-x} ## for some ## B ##. ## \\ ## The constants ## A ## and ## B ## are easily found.
 
Last edited:
  • #5
Charles Link
Homework Helper
Insights Author
Gold Member
2020 Award
5,060
2,354
@Buffu I edited my comments in post #4, because I see your solution, using an integrating factor, actually resulted in generating the necessary homogeneous solution. There is, as @epenguin pointed out, a simple solution that doesn't require an integrating factor. Please see my edited post #4.
 
Last edited:
  • #6
850
146
Yes I see what mistake I made.
Thank you.

For the integrating factor, I did not see that DE here is a simple separable because I overlooked the condition on ##f(x)##. I thought, let me reduce the equation first then I will care about ##f(x)##.
 
  • Like
Likes Charles Link

Related Threads on Linear ordinary differential equation.

Replies
2
Views
1K
Replies
9
Views
2K
Replies
3
Views
1K
Replies
2
Views
1K
Replies
1
Views
1K
Replies
11
Views
2K
Replies
1
Views
962
Replies
5
Views
659
Replies
1
Views
428
  • Last Post
Replies
5
Views
1K
Top