1. Grundlagen

Beispiele aus https://docs.sympy.org/latest/tutorial/intro.html

from sympy import *
init_printing(use_unicode=True) # This will make all further examples pretty print with unicode characters.

1.1. Parameter definieren

x, t, z = symbols('x t z')

Differenzieren

Take the derivative of \(sin(x)e^x\).

diff(sin(x)*exp(x), x)
../../_images/Grundlagen_6_0.png

Integrieren

Compute \(∫(e^x sin(x)+e^x cos(x))dx\)

integrate(exp(x)*sin(x) + exp(x)*cos(x), x)
../../_images/Grundlagen_8_0.png

Compute \(\int_{∞}^{−∞}sin(x^2)dx\)

integrate(sin(x**2), (x, -oo, oo))
../../_images/Grundlagen_10_0.png

Gleichung lösen

Solve \(x^2−2=0\)

solve(x**2 - 2, x)
../../_images/Grundlagen_12_0.png

Differentialgleichung lösen

Solve the differential equation \(y′′−y=e^t\)

y = Function('y')
dsolve(Eq(y(t).diff(t, t) - y(t), exp(t)), y(t))
../../_images/Grundlagen_14_0.png