t=var('t')
s(t)= t^3-6*t^2
p0= plot(s(t),-50,50,ymin=-50,ymax=50,legend_label='s(t)=t^3-6t^2',frame=True,color='black')
p0.axes_labels(['s-axis','t-axis'])
p0.show()
print('this is the graph of the given position function')
v(t)=diff(s(t),t)
print('the velocity of the position function is', v(t))
a(t)=diff(s(t),t,2)
print('the acceleration of the postion function is', a(t))
f(t)=abs(sqrt(3^2+(-12)^2))
print('the speed of the position function is', f(t))
p1=plot(v(t),-10,10,ymin=-30,ymax=30,legend_label='v(t)',frame=True,color='green')
p1.axes_labels(['s-axis','t-axis'])
p2=plot(a(t),-10,10,ymin=-30,ymax=30,legend_label='a(t)',frame=True,color='red')
p2.axes_labels(['s-axis','t-axis'])
p3=plot(f(t),-10,10,ymin=-30,ymax=30,legend_label='f(t)',frame=True,color='blue')
p3.axes_labels(['s-axis','t-axis'])
show(p0+p1+p2+p3)
print('velocity is at a minimum')
solve(-40==3*t^2-12*t,t)
print('acceleration is at a minimum')
solve(-40==6*t^2-12,t)
print('speed is at a maximum')
solve(0==3*t^2-12*t,t)
print('velocity is at a maximum')
solve(0==3*t^2-12*t,t)
print('acceleration is at a maximum')
solve(0==6*t-12,t)
q=var('q')
c(q)= (600)/0.3*q+5
print('c(q) is', c(q))
p4=plot(c(q),-10,10,ymin=-30,ymax=30,legend_label='c(q)',frame=True,color='blue')
p4.axes_labels(['x-axis','y-axis'])
dcq= diff(c(q),q)
print('the derivative is', dcq)
p5=plot(c(q),-10,10,ymin=-30,ymax=30,legend_label='c(q)',frame=True,color='blue')
p4.axes_labels(['x-axis','y-axis'])
p5=plot(dcq,-10,10,ymin=-30,ymax=30,legend_label='derivative of c(q)',frame=True,color='red')
p5.axes_labels(['x-axis','y-axis'])
show(p4+p5)
icq=integral(c(q),q,0,30)
print('the integral as we produce 30 bikes is',icq)
p6=plot(icq,-10,10,ymin=-30,ymax=30,legend_label='integral of c(q), producing 30 bikes',frame=True,color='red')
p6.axes_labels(['x-axis','y-axis'])
icq2=integral(c(2000),2000,0,30)
print('the integral as we produce 30 bikes with a fixed cost of 2000 is', icq2)
p7=plot(icq2,-10,10,ymin=-30,ymax=30,legend_label='fixed cost of 2000, producing 30 bikes',frame=True,color='red')
p7.axes_labels(['x-axis','y-axis'])
show(p6+p7)