Solving a Linear Piecewise ODE

  • Thread starter Thread starter Bcranger 0
  • Start date Start date
  • Tags Tags
    Linear Ode
Bcranger 0
Messages
10
Reaction score
0

Homework Statement


Solve the piecewise linear ODE, y' - y = f(x), y(0) = 1, where
f(x) = 1 when 0<=x<=1 and f(x) = -1 when x > 1.

y(2) = ?

Homework Equations


None


The Attempt at a Solution


I found the integrating factor to be e^-x and multiplied both sides of the equation by the integrating factor.

I rewrote the equation as the d/dx(e^-x * y) = e^-x * f(x). I integrated both sides to get e^-x * y = -e^-x * f(x) + C.

Solving for y, I got y = -f(x) + C/e^-x. Using the initial value y(0)=1, I managed to find C as +2. Solving for y(2) there onwards, I obtained an answer of 15.7781, which was said to be the wrong answer. I am not sure where I went wrong!


I would appreciate any help on solving this problem using the "5 Steps Method" aka the basic method for solving an inhomogeneous linear DE.
 
Physics news on Phys.org
You have two different differential equations. Try solving first in the range 0<x<1 for y(1) and then use this as an initial condition for the second equation to find y(2).
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top