In this notebook we complete the project for section 2.6 of Stewart's book.
This notebook was made using SageMath (http://sagemath.org) in a browser-based Jupyter notebook (http://jupyter.org).
version()
%display latex
(x,y) = var('x y');
left = y**2 - 2*x**2*(x+8);
right = (y+1)**2*(y+9) - x**2;
c =[None]*2;
c[0] = implicit_plot(left == 0,(x,-1,1),(y,-1.5,-0.5));
c[1] = implicit_plot(left == 2*right,(x,-1,1),(y,-1.5,-0.5),color='red');
show(sum(c),title='Part 1.a')
c.append(implicit_plot(left == 5*right,(x,-1,1),(y,-1.5,-0.5),color='green'));
c.append(implicit_plot(left == 10*right,(x,-1,1),(y,-1.5,-0.5),color='purple'));
show(sum(c),title='Part 1.b')
k = var('k');
f = x**2 + y**2 + k*x**2*y**2;
cc = [None];
for j in [-6..6]:
if j == -6:
cc[0] = implicit_plot(f(k = j/3) == 1,(x,-2,2),(y,-2,2),color=hue((12+j)/18));
else:
cc.append(implicit_plot(f(k = j/3) == 1,(x,-2,2),(y,-2,2),color=hue((12+j)/18)));
show(sum(cc),title='Part 2.a')
implicit_plot(f(k = -1) == 1,(x,-2,2),(y,-2,2),title='Part 2.b')
var('x k');
y = function('y')(x);
ff = x**2 + y**2 + k*x**2*y**2;
impd = ff.diff(x);
z = solve(impd == 0,y.diff(x))
z[0]
impd(k = -1)