Linear ordinary differential equation.

Click For Summary
SUMMARY

The discussion focuses on solving the linear ordinary differential equation (ODE) given by the equation \(\frac{dy}{dx} + y = f(x)\), where \(f(x)\) is defined piecewise. The integrating factor used is \(e^x\), leading to the solution for \(y\) in two intervals: \(y = 2(e^x - 1)\) for \(0 \leq x < 1\) and \(y = 2(e - 1)\) for \(x \geq 1\). Participants highlight the importance of considering the homogeneous solution \(y_h = A e^{-x}\) and suggest that the problem can be simplified by treating it as two separate differential equations. The discussion concludes with insights on the necessity of continuity at \(x=1\) and the oversight of the separable nature of the equation.

PREREQUISITES
  • Understanding of linear ordinary differential equations
  • Familiarity with integrating factors in ODEs
  • Knowledge of piecewise functions and their implications
  • Concept of homogeneous solutions in differential equations
NEXT STEPS
  • Study the method of integrating factors in depth
  • Learn about homogeneous and particular solutions of ODEs
  • Explore the concept of continuity in piecewise functions
  • Investigate the separation of variables technique for solving ODEs
USEFUL FOR

Students and educators in mathematics, particularly those studying differential equations, as well as anyone seeking to deepen their understanding of linear ODEs and their solutions.

Buffu
Messages
849
Reaction score
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 :(.
 
Physics news on Phys.org
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 ##.
 
  • Like
Likes   Reactions: Buffu
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.
 
  • Like
Likes   Reactions: Buffu
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:
@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:
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   Reactions: Charles Link

Similar threads

  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 105 ·
4
Replies
105
Views
7K
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
8
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
1K