# Math 238 - Differential Equations With Sage

This is a small collection of SageMath input and interactive cells.

## Solving a Differential Equation

**1)** Solve the differential equation with initial condition:

$y' +4y = 5x^2$, $y(0) = 2$,

We will also plot the solution.

**2)** Solve the second order equation:

$y''(x)-y'(x)+3y(x)=0$ with initial conditions $y(0)=10$ and $y'(0)=1$.

## Slope Fields with Sage

**3.** Create a slope field for the differential equation: $y'=x-y^2$

**4.** Now add some stream lines to show possible solutions

**5.** Plot a slopefield and one solution curve

## 3D-plots

**6.** Let's plot the 3D graph of $$y=cos(x^2+y^2)e^{-(x^2+y^2)/5}$$ along with a sphere of radius 1 with center at $(0,0,1)$.