Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 5215
#Midterm #Before any command include a comment about the command output. #Each problem is worth 10 points.
#################################################################
################### Problem 1 #Find a PPT with one of the legs equal 175. #Solution: #1: s=1,t=175:(175,15312,15313) #2: s=3,t=35 :(175,600,625) #3: s=7,t=25 :(175,288,337) #it all works so it has 3 PPT
################### Problem 2 #Find nonnegative solutions to the LDE 3x+7y=45. #Hint: Find a particular solution to the LDE 3x+7y=1 using appropriate SageMath command; modify the result to get a particular solution to the given LDE; find the general solution to the given LDE; select nonneqative solutions if any. #Solution: xgcd(3,7)
(1, -2, 1)
#general solution: x=-90+7n ; y=45-3n #check:3(-90+7n)+7(45-3n)=-270+21n+315-21n=45
################### Problem 3 #Consider three points A(1,2), B(-5/2,3), and C(4/3,40/21). #(a)Find the equation of the line passing through the points A and B. #(b) Determine if the line passes through point C #(c) Plot the three points and the line AB in one figure. #Solution #(a):m=(3-2)/((-5/2)-1)=-2/7 # y=(-2/7)*x+b use point A(1,2) # 2=-2/7+b # b=16/7 # y=-2/7x+16/7
#(b):-2/7*(4/3)+16/7= -8/21+16/7 = -8/21+48/21 = 40/21 # The line passes through point c
#(c): f(x)=-2/7x+16/7 p=plot(f(x),-5,10,legend_label='f(x)',color='black',thickness=2) pt_plot=point(pt,size=30,color='green',figsize=[4,3])
pt_plot=point(pt,size=30,color='green',figsize=[4,3]) ################### Problem 4 #Use completing the square technique and translation transformation to obtain the equation of the conic 2*x^2+y^2-3*x+6*y+1=0 in the standard form. Identify the name of the conic. Make a plot of the original equation in xy-plane and identify the image of the origin under the translation transformation. # completing the square: # 2*x^2-3x+y^2+6y+1=0 # 2(x-3/4)^2+(y+3)^2+9/8+9+1=0 # 2(x-3/4)^2+(y+3)^2+89/8=0 # 2(x-3/4)^2+(y+3)^2=-89/8 # -(16(x-3/4)^2)/(sqr(89)^2)-(8(y+3)^2)/(sqr(89)^2)=1 # It is a ellipse conic
#Plotting:
################### Problem 5 #Make a list of all 4th roots of unity. Make a plot of the roots on the unit circle. Write the polynomial equation that has the same roots. #Making a list: #a0+a1*x+a2x^2+a3*x^3+a4*x^4 def roots_of_unity(n): L=[N(cos(2*pi*k/n)+(i*sin(2*pi*k/n))) for k in range(n)] return L L=roots_of_unity(4);L S=[(L[j].real(),L[j].imag()) for j in range(4)];S point(S,aspect_ratio=1,size=30)
#Plotting:
L=roots_of_unity(4);L S=[(L[j].real(),L[j].imag()) for j in range(4)];S point(S,aspect_ratio=1,size=30)
################### Problem 6 #Consider the function f(x)=(x+10)/(x+3)+sin(5/(x-3)). Use the plot of the function, SageMath assistance, and relevant calculus facts to find #(a) the x- and y-intercepts #(b) The locations and the values of the largest local maximum and the smallest local minimum of f. #(c) The equation of the tangent line passing through the point where the largest local maximim is attained. #(d) Plot the function and the tangent that you found in part (c) in one figure. Use different colors. (You can earn 5 extra points for adding the legend to the figure.)
# (a)
#(b)
#(c) and (d) ︠456ddb53-323a-4b19-b214-6415e35ed88f︠