Solve Linear ODE with Discontinuous f(x)

In summary, the conversation focused on a problem involving a first order linear differential equation with a piecewise function. The solution involved finding an integrating factor and using it to solve for two cases of the piecewise function. However, one of the solutions was found to be incorrect due to a mistake in the initial condition. It was then pointed out that simpler methods, such as separation of variables, could have been used to solve the problem. Finally, it was noted that there are various methods for solving first order linear ODEs, but integrating factors and separation of variables are commonly used.
  • #1
1s1
20
0

Homework Statement



$$\frac{dy}{dx}+y=\left\{\begin{matrix}1, \ 0\leq x< 1
\\
0, \ x\ge1 \ \ \ \ \ \ \
\end{matrix}\right.$$

Homework Equations





The Attempt at a Solution


$$P(x)=1$$
Integrating factor ##=e^{x}##

For ##f(x)=1##:
$$\frac{d}{dx}[e^{x}y]=e^{x}$$
Integrating both sides:
$$e^{x}y=e^{x}+C$$
$$y=1+\frac{C}{e^{x}}, y(0)=1$$
$$C=0$$
$$\fbox{y=1}$$

For ##f(x)=0##:
$$\frac{d}{dx}[e^{x}y]=0$$
Integrating both sides:
$$e^{x}y=C$$
$$y=\frac{C}{e^{x}}, y(0)=1$$
$$C=1$$
##y=\frac{1}{e^{x}}## <-- This one is coming back incorrect

I have worked through this problem multiple times, but my WeBWorK assignment keeps saying the second solution, the one for ##f(x)=0## is incorrect. I can't figure out what I'm doing wrong?! Any help would be greatly appreciated!
 
Physics news on Phys.org
  • #2
1s1 said:

Homework Statement



$$\frac{dy}{dx}+y=\left\{\begin{matrix}1, \ 0\leq x< 1
\\
0, \ x\ge1 \ \ \ \ \ \ \
\end{matrix}\right.$$

Homework Equations





The Attempt at a Solution


$$P(x)=1$$
Integrating factor ##=e^{x}##

For ##f(x)=1##:
$$\frac{d}{dx}[e^{x}y]=e^{x}$$
Integrating both sides:
$$e^{x}y=e^{x}+C$$
$$y=1+\frac{C}{e^{x}}, y(0)=1$$
$$C=0$$
$$\fbox{y=1}$$

For ##f(x)=0##:
$$\frac{d}{dx}[e^{x}y]=0$$
Integrating both sides:
$$e^{x}y=C$$
$$y=\frac{C}{e^{x}}, y(0)=1$$
$$C=1$$
##y=\frac{1}{e^{x}}## <-- This one is coming back incorrect

I have worked through this problem multiple times, but my WeBWorK assignment keeps saying the second solution, the one for ##f(x)=0## is incorrect. I can't figure out what I'm doing wrong?! Any help would be greatly appreciated!

Look at this :

$$y=\frac{C}{e^{x}}, y(0)=1$$

You're claiming ##x=0## for the initial condition, but ##x## is defined to be greater than or equal to 1.
 
  • #3
Good point! I suppose I would need a different initial condition for this function?
 
  • #4
Figured it out ... thanks Zondrina!

Have to appeal to the definition of continuity at a point.

So, you can say that ##Ce^{-1}=1##
$$C=e$$
And the solution for ##x \geq 0##
$$y=\frac{e}{e^{x}}$$

Thanks!
 
  • #5
Sounds like there must be some fresh Prof. very keen on integrating factors and his students are coming here this last day or so using them where they're not needed!

You have a couple of nearly the most simple ode's there are!
 
  • #6
Ha, ha good point! I suppose simple separation of variables would be SO much simpler. By the way, I'm new to working with ODE's, is using integrating factors pretty typical or are there alternative methods that are more common? Guess I'll probably find out more as I learn more about diffEq.
 
  • #7
1s1 said:
Ha, ha good point! I suppose simple separation of variables would be SO much simpler. By the way, I'm new to working with ODE's, is using integrating factors pretty typical or are there alternative methods that are more common? Guess I'll probably find out more as I learn more about diffEq.

There are lots of different methods for solving first order linear ODEs. Some first order linear ODEs have more than one method which can be applied to find the correct answer ( As was in this case actually. You could have separated variables or used an integrating factor ). You're probably going to learn more methods along the way, but integrating factors and variable separation are very prominent methods.
 
  • #8
I mean to say it is just two equations; the second equation is just dy/dx = -y → dy/y = -dx
→ d(ln y) = -dx
and the first is d(y - 1)/dx = - (y - 1) , dealt with in same way.
 

1. What is a linear ODE with discontinuous f(x)?

A linear ODE (ordinary differential equation) with discontinuous f(x) is a type of differential equation where the function f(x) is not continuous. This means that there are points along the solution where the function is undefined or has a jump in its value.

2. How do you solve a linear ODE with discontinuous f(x)?

To solve a linear ODE with discontinuous f(x), you can use a variety of methods such as the Laplace transform, the method of undetermined coefficients, or the method of variation of parameters. The specific method used will depend on the form of the ODE and the given initial conditions.

3. Why is it important to consider discontinuous f(x) in linear ODEs?

In many real-world scenarios, the function f(x) may not be continuous due to sudden changes or disruptions in the system being modeled. Therefore, it is important to consider discontinuous f(x) in linear ODEs to accurately reflect these changes and obtain a more precise solution.

4. Can linear ODEs with discontinuous f(x) have multiple solutions?

Yes, linear ODEs with discontinuous f(x) can have multiple solutions. This is because the discontinuity in f(x) can result in different behaviors or solutions for the ODE. Therefore, it is important to specify initial conditions when solving these types of ODEs to obtain a unique solution.

5. Are there any limitations or challenges when solving linear ODEs with discontinuous f(x)?

One limitation of solving linear ODEs with discontinuous f(x) is that the methods used may not always produce an exact solution. In some cases, an approximate solution may need to be obtained. Additionally, the discontinuity in f(x) can make the ODE more difficult to solve and may require more advanced mathematical techniques.

Similar threads

  • Calculus and Beyond Homework Help
Replies
5
Views
559
  • Calculus and Beyond Homework Help
Replies
18
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
635
  • Calculus and Beyond Homework Help
Replies
4
Views
437
  • Calculus and Beyond Homework Help
Replies
3
Views
221
  • Calculus and Beyond Homework Help
Replies
5
Views
193
  • Calculus and Beyond Homework Help
Replies
21
Views
755
  • Calculus and Beyond Homework Help
Replies
2
Views
171
  • Calculus and Beyond Homework Help
Replies
6
Views
505
  • Calculus and Beyond Homework Help
Replies
8
Views
709
Back
Top