The code from this video is listed below.
import sympy as sp
l, w = sp.symbols("l, w")
area = l * w
circumference = 2 * l + 2 * w
sp.solve(sp.Eq(circumference, 10), l)
sp.solve(sp.diff(area.subs(l, -w + 5), w), w)
sympy: applied maths
The code from this video is listed below.
import sympy as sp
l, w = sp.symbols("l, w")
area = l * w
circumference = 2 * l + 2 * w
sp.solve(sp.Eq(circumference, 10), l)
sp.solve(sp.diff(area.subs(l, -w + 5), w), w)