SymPy Flashcards

1
Q
A

from sympy import symbols, solve

x = symbols(‘x’)
equation = x**2 - 4
solution = solve(equation, x)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
A

from sympy import symbols, sin, cos, integrate

x = symbols(‘x’)
expression = sin(x) * cos(x)
integral = integrate(expression, x)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
A

from sympy import symbols, diff

x = symbols(‘x’)
expression = x3 + 2x**2 + 3x + 4
derivative = diff(expression, x)
print(derivative)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
A

from sympy import symbols, Function, dsolve

x, y = symbols(‘x y’)
f = Function(‘f’)
equation = f(x).diff(x) - x*f(x)
solution = dsolve(equation, f(x))
print(solution)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
A

from sympy import Matrix

A = Matrix([[1, 2], [2, 1]])
eigenvalues = A.eigenvals()
eigenvectors = A.eigenvects()
print(“Eigenvalues:”, eigenvalues)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly