Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 60
#Daniel Cleary #April 30, 2018 #Professor Laura Gross #Sage Application Assignment show("Exploring the use of Variables in Sage") show("The Use of Variables in Algebra & Calculus")
Exploring the use of Variables in Sage
The Use of Variables in Algebra & Calculus
show("1.) If a = 3, b = 4, and c = 7, find f(a), f(b), and f(c) if f(x) = x^2 + 2x + 5")
1.) If a = 3, b = 4, and c = 7, find f(a), f(b), and f(c) if f(x) = x^2 + 2x + 5
#Variables shown below include a, b, c, and the function f(x). a = 3 b = 4 c = 7 f(x) = x**2 + 2*x + 5 show("f(a) =") show(f(a)) show("-----") # show("f(b) =") show(f(b)) show("-----") # show("f(c) =") show(f(c))
f(a) =
20\displaystyle 20
-----
f(b) =
29\displaystyle 29
-----
f(c) =
68\displaystyle 68
show("2.) Graph the same points, a, b, and c, for f(x).")
2.) Graph the same points, a, b, and c, for f(x).
#The variables will be recycled for the x values, and the y values will be subbed by f(a), f(b), and f(c) to display implementation of variables. plot(f(x), -12, 10) + point((a,f(a)), size=30) + point((b,f(b)), size=30) + point((c,f(c)), size=30)
show("3.) Let's say d = -x + 3, e = x - 1, f = x + 5. Graph d*e, d*f, and e*f and explain their patterns.")
3.) Let's say d = -x + 3, e = x - 1, f = x + 5. Graph d*e, d*f, and e*f and explain their patterns.
d(x) = (-x + 3) e(x) = (x - 1) f(x) = (x + 5) show("'d' has a negative leading coefficient, so all graphs containing d are concave down.") show("All graphs containing 'd' have a zero at 3") show("All graphs containing 'e' have a zero at 1") show("All graphs containing 'f' have a zero at -5") plot(d*e, -15,10) + plot(d*f, -15,10, color='green') + plot(e*f, -15,10, color='red')
'd' has a negative leading coefficient, so all graphs containing d are concave down.
All graphs containing 'd' have a zero at 3
All graphs containing 'e' have a zero at 1
All graphs containing 'f' have a zero at -5
show("4.) Plot d*e*f, mark all zero points throughout the graph.")
4.) Plot d*e*f, mark all zero points throughout the graph.
plot(d*e*f,-10,10) + point((3,d(3)), size=30, color='red') + point((1,e(1)), size=30, color='green') + point((-5,f(-5)), size=30)
show("5.) Find the max and min of the graph displayed in #4.")
5.) Find the max and min of the graph displayed in #4.
show("We know the maxes and mins are the midpoints of each point after finding the zeros, so we can solve by plugging them in.") show("-----") show("Min =") show(d(-2)*e(-2)*f(-2)) show("-----") show("Max =") show(d(2)*e(2)*f(2))
We know the maxes and mins are the midpoints of each point after finding the zeros, so we can solve by plugging them in.
-----
Min =
45\displaystyle -45
-----
Max =
7\displaystyle 7