Set variables x, y, z, and function f, and g.
Set an expression for the following: $$x^2+2x-5.$$
Evaluate the expression for $x=1.5$. Also, make a variable substitution: $z$ for $x$. Do a variable substitution $y^2$ for x.
Expand the following expression symbolically: $$(x+1)^3(x-2)^2.$$
Factor the following expression: $$3x^4 - 36x^3+99x^2-6x-144.$$
Create a sympy expression representing the following integral: $$\int_0^5x^2\sin(x^2)dx.$$
Then evaluate the integral symbolically.
Solve for the roots of the following equation: $$x^3+15x^2=3x-10.$$
Use the Eq
and solve
functions and save as an expression. Show the expression (it will be a list). Then find the numerical value of each root using the evalf function. You can use evalf on some expression using my_expression.evalf()
.
Solve the system of three equations in three unknowns symbolically:
$$x+y+z=0,$$$$2x-y-z=10,$$$$y+2z=5.$$Compare the result to the answer computed with fsolve from scipy.optimize.
Solve the following differential equation symbolically using the dsolve
function:
$$\frac{df(x)}{dx} = x\cos(x).$$
For the system in Part a, solve for matrix $x$ by matrix algebra.
For matrix A above, return the middle row, and the middle column.