Solving a Diff. Equation: y'=x+y, y(0)=2

  • Thread starter skyturnred
  • Start date
In summary, the conversation is about solving a differential equation, y'-y=x, with the initial condition y(0)=2. The person attempted to rearrange and integrate the equation, but made a mistake and ended up with a wrong answer. They were able to correct their mistake after receiving a hint about using an integrating factor.
  • #1
skyturnred
118
0

Homework Statement



Solve:

y'=x+y, y(0)=2

Homework Equations


The Attempt at a Solution



I THINK my method is correct.. but I messed up somewhere.

I rearrange for y'-y=x

integrate both sides gets me:

y-[itex]\frac{y^{2}}{2}[/itex]=[itex]\frac{x^{2}}{2}[/itex]

after completing the square I get

(y-1)[itex]^{2}[/itex]=-x[itex]^{2}[/itex]+1

But this is where I mess up. To solve for y, I square root each side. But then I get '+ or -' on the right side:

y=[itex]\pm[/itex][itex]\sqrt{-x^{2}+1}[/itex]+1+c

so solving for both cases gets me c=0 OR c=2. But I can only have once answer. Where did I go wrong?
 
Last edited:
Physics news on Phys.org
  • #2
skyturnred said:

Homework Statement



Solve:

y'=x+y, y(0)=2

Homework Equations





The Attempt at a Solution



I THINK my method is correct.. but I messed up somewhere.

I rearrange for y'-y=x

integrate both sides gets me:

y-[itex]\frac{y^{2}}{2}[/itex]=[itex]\frac{x^{2}}{2}[/itex]

after completing the square I get

(y-1)[itex]^{2}[/itex]=-x[itex]^{2}[/itex]+1

But this is where I mess up. To solve for y, I square root each side. But then I get '+ or -' on the right side:

y=[itex]\pm[/itex][itex]\sqrt{-x^{2}+1}[/itex]+1+c

so solving for both cases gets me c=0 OR c=2. But I can only have once answer. Where did I go wrong?

Going from y'-y=x to [itex]y-\frac{y^2}{2} =\frac{x^2}{2}[/itex] is wrong. The DE reads as [itex] dy - y dx = x dx,[/itex] so when you integrate on the left you don't get y - y^2/2. You need to use an "integrating factor"; see http://www.ucl.ac.uk/Mathematics/geomath/level2/deqn/de8.html , or read your textbook.

RGV
 
  • #3


Thanks! Your hint helped me get the right answer!
 

1. What is a differential equation?

A differential equation is an equation that relates a function to its derivatives. It is used to model various real-life phenomena in fields such as physics, chemistry, and engineering.

2. What does the notation "y' = x + y" mean?

The notation "y' = x + y" means that the derivative of the function y with respect to x is equal to the sum of x and y. This is known as a first-order, linear differential equation.

3. What is the initial value problem for this differential equation?

The initial value problem for this differential equation is y(0) = 2, which means that the value of the function y at x=0 is equal to 2. This initial condition is necessary to find a specific solution to the differential equation.

4. How do you solve this differential equation?

To solve this differential equation, we can use various techniques such as separation of variables, integrating factors, or the method of undetermined coefficients. In this case, the solution can be found by using separation of variables and then using the initial condition to find the constant of integration.

5. What is the final solution to this differential equation?

After solving the differential equation, the final solution is y = -x -1 + 3e^x. This solution satisfies the given differential equation and the initial condition y(0) = 2.

Similar threads

  • Calculus and Beyond Homework Help
Replies
6
Views
695
  • Calculus and Beyond Homework Help
Replies
7
Views
641
  • Calculus and Beyond Homework Help
Replies
6
Views
505
  • Calculus and Beyond Homework Help
Replies
4
Views
635
  • Calculus and Beyond Homework Help
Replies
2
Views
478
  • Calculus and Beyond Homework Help
Replies
2
Views
458
  • Calculus and Beyond Homework Help
Replies
18
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
401
  • Calculus and Beyond Homework Help
Replies
3
Views
570
Replies
7
Views
464
Back
Top