SAGE : Euler's Method

This page shows the code for Euler's Method, a simple numeric method to solve a differential equation in the form \[y'=f(x,y)\]

1. Use Euler's Method to approximate $y(1)$ for $y'=x-y^2$ and $y(0)=1$.

This first method uses 100% SageMath but doesn't have nice looking output, however it is very simple code.

2. This snippet of code tries to improve the output, however the function $f(x,y)$ needs to be created using the Python code def.

Both snippets can be altered to make the Improved Euler's Method or the Runge-Kutta Method.