Examples from Section 6.11
First Order Differential Equations

p. 537

Verifying Solutions

1.

a)

y  =  (E^(-x));

2 (∂_x) y  +  3 y

2 (∂_x) y  +  3 y ==  (E^(-x))

b)

y  =  (E^(-x))  +  (E^(-(3/2) x));

2 (∂_x) y  +  3 y

Simplify[%]

2 (∂_x) y  +  3 y ==  (E^(-x))  // Simplify

7.

y  =  Cos[x]/x;

x (∂_x) y  +  y

Simplify[%]

x (∂_x) y  +  y  ==  - Sin[x]  // Simplify

y  /.  x  ->  π/2

Separable Equations

9.

Clear[y]

DSolve[  y'[x] ==  2 (x  +  y[x]^2 x),  y[x],  x]

Separating variables: \(TraditionalForm
      \`dy\/\(1\  + \ y\^2\)\  = \ 2  x\ dx\)

∫(1/(1  +  (y^2))) \[DifferentialD]y  ==  
      ∫2  x \[DifferentialD]x  +  C

11.

Clear[y]

DSolve[2 (Sqrt[ x y[x] ]) y'[x]  ==  1,  y[x], x]

Separating variables: (Sqrt[y]) dy= (1/(2 (Sqrt[ x]))) dx

∫(Sqrt[y]) \[DifferentialD]y ==  
      ∫ (1/(2 (Sqrt[ x]))) \[DifferentialD]x  +  C

Solve[%,  y]

Linear First Order Equations

15.

The standard form of the equation is y'  +   (1/x) y  =  (1/x) (e^x). So we should muplitply by \(TraditionalForm
      \`v\  = \ \(e\^\(∫\(1\/x\) d\ x\)\  = \ 
          \(e\^\(ln(x)\) = \ x\)\)\)to get back to where we started! x y' + y = (e^x)can be rewritten as (∂_x) (x y)  =  (e^x) . Integrating this equation gives x y  =  (e^(x )) +  C or y  =  ((e^x)/x)  +  (C/x).

DSolve[ x y'[x]  +  y[x]  ==  (E^x),  y[x],  x]

17.

The standard form of the equation is y'  +   (3/x) y  =  ((sin(x))/(x^3)). So we should muplitply by \(TraditionalForm
      \`v\  = \ \(e\^\(∫\(3\/x\) d\ x\)\  = \ 
          \(e\^\(3 \( ln(x)\)\) = \ x\^3\)\)\)to get  (x^3) y'  +  3  (x^2) y  =  sin(x). The left hand side can be rewritten as (∂_x) ((x^3) y). Integrating this equation gives (x^3) y  =  -cos(x) +  C or y  = - ((cos(x))/(x^3))  +  (C/(x^3)).

DSolve[ x y'[x]  + 3 y[x]  ==  Sin[x]/(x^2),  y[x],  x]

39.

The standard form of the equation is \(TraditionalForm
      \`y'\  - \ \ 2\ x\ y\  = \ e\^\(x\^2\)\/\((x + 1)\)\^2\). So we should muplitply by \(TraditionalForm
      \`v\  = \ \(e\^\(∫\(-2\) x d\ x\)\  = \ 
          e\^\(-x\^2\)\)\)to get  \(TraditionalForm
      \`\(e\^\(-x\^2\)\) y'\  - 2  x\ \(e\^\(-x\^2\)\) y\  = 
        1\/\((x + 1)\)\^2\). The left hand side can be rewritten as (∂_x) ((e^(-(x^2))) y). Integrating this equation gives (e^(-(x^2))) y  = -(1/(x + 1)) +  C or \(TraditionalForm
      \`y\  = \(-\ \(e\^\(x\^2\)\/\(x + 1\)\)\)\  + \ C\ e\^\(x\^2\)\). The initial condidtion is y(0) = 5 so 5  =  -((e^0)/(0 + 1)) +  C (e^0) 
      and C  =  6. The final solution is 
      y  = - ((e^((x^2)))/(x + 1))  +  6 (e^((x^2))) =  
          (((e^((x^2))) (5 + 6 x))/(1 + x)) .

DSolve[
       {(x + 1) y'[x]  -  2 ((x^2) + x) y[x]  ==  
          ((E^((x^2)))/(x + 1)), y[0]  ==  5}, y[x],  x]