Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168694
Image: ubuntu2004

Friday, April 30, 2010

This is messing around with Eric and David.  We started with the equation 3xy2x3=03xy^2-x^3=0.  What does this graph look like?

w=solve(3*x*y^2 - x^3 - 1 == 0, y); w
[y == -1/3*sqrt(x^2 + 1/x)*sqrt(3), y == 1/3*sqrt(x^2 + 1/x)*sqrt(3)]

Having solved for yy, it can be graphed.  I used "copy and paste" to get the equations.  I also needed to split the graphs into two pieces to avoid the discontinuity at the yy-axis.

var('x,y') L=plot(-1/3*sqrt(x^2 + 1/x)*sqrt(3),x,0,5) L=L+plot(-1/3*sqrt(x^2 + 1/x)*sqrt(3),x,-5,-1) L1=plot(1/3*sqrt(x^2 + 1/x)*sqrt(3),x,0,5) L1=L1+plot(1/3*sqrt(x^2 + 1/x)*sqrt(3),x,-5,-1) X=plot(x,x,-5,5, color="red") A=plot((3^(-1/2))*x, x, -5,5, color="black",linestyle=':') A=A+plot(-(3^(-1/2))*x, x, -5,5, color="black",linestyle=':') show(L+L1+X+A, aspect_ratio=1)

In this second version, I let the results of Sage's solve command get passed to plot.

var('x,y') w=solve(3*x*y^2 - x^3 - 1 == 0, y) L=plot(w[0].rhs(),x,0,5) L=L+plot(w[0].rhs(),x,-5,-1) L1=plot(w[1].rhs(),x,0,5) L1=L1+plot(w[1].rhs(),x,-5,-1) X=plot(x,x,-5,5, color="red") A=plot((3^(-1/2))*x, x, -5,5, color="black",linestyle=':') A=A+plot(-(3^(-1/2))*x, x, -5,5, color="black",linestyle=':') show(L+L1+X+A, aspect_ratio=1)