# Experimental Math Rocks! # Homework 18 # Phil Benjamin # Note: this homework is a transcript of the sage session # that I completed online after the class. # Using sage online: # Website: sagenb.org # You need a login/password. However, you can instead # reuse an existing login on Google, Yahoo, OpenID, etc. # (I have a Google account so I used that) # After that you will be able to use sage online # For sage tutorial, go to website: sagemath.org # You can download a copy of sage for your PC but # Eddie did not recommend this! # At this website you can select Tour -> Quickstart # to get a quick overview # For more information, go to Support -> Video # or Support -> Tutorial # I reviewed the Video: "William Stein introduces Sage" # This was very interesting and informative. # The remainder of this file shows the sage instructions # in this video demo. # (There are more videos at this website for future enjoyment!) # Demo based on first video sage: 2+3 5 sage: factor(2010) 2 * 3 * 5 * 67 sage: f = x^2 + x - 3 sage: f.integrate(x) 1/3*x^3 + 1/2*x^2 - 3*x sage: a = random_matrix(QQ,3,4);a [ -1 -1/2 0 0] [ 1 2 0 -2] [ -1 -1 2 0] sage: a.echelon_form() [ 1 0 0 2/3] [ 0 1 0 -4/3] [ 0 0 1 -1/3] sage: x,y=var('x,y');factor(x^3-y^3) (x - y)*(x^2 + x*y + y^2) sage: F.=GF(49) sage: x=polygen(F) sage: factor(x^4+x^3-2) (x + alpha + 1) * (x + 6*alpha + 2) * (x + 6)^2 sage: x=var('x');solve(x^2+7*x==5,x) [x == -1/2*sqrt(69) - 7/2, x == 1/2*sqrt(69) - 7/2] sage: var('alpha,x,y') sage: solve([3*x+7*y==2,alpha*x+3*y==9],[x,y]) [[x == 57/(7*alpha - 9), y == (2*alpha - 27)/(7*alpha - 9)]] sage: A=matrix([[3,7],[alpha,3]]) sage: v=vector([2,8]) sage: A.solve_right(v) (-14/3*(alpha - 12)/(7*alpha - 9) + 2/3, 2*(alpha - 12)/(7*alpha - 9)) sage: f=1/sqrt(x^2+2*x-1) sage: f.integrate(x) log(2*x + 2*sqrt(x^2 + 2*x - 1) + 2) sage: g=integrate(sin(x)*tan(x),x);g -1/2*log(sin(x) - 1) + 1/2*log(sin(x) + 1) - sin(x) sage: h=g.diff(x);h -1/2*cos(x)/(sin(x) - 1) + 1/2*cos(x)/(sin(x) + 1) - cos(x) sage: h.simplify_full() -sin(x)^2*cos(x)/(sin(x)^2 - 1) sage: var('x,y') sage: plot3d(sin(x-y)*y*cos(x),(x,-3,3),(y,-3,3)) sage: # Needs Firefox! to complete this