Calculus 1 - Lab 1b - Team 5
In [5]:
#%matplotlib notebook
%matplotlib inline
#init_session(use_unicode=True)
from __future__ import division
from sympy import *
x, y, z, t = symbols('x y z t', real=True)
k, m, n = symbols('k m n', integer=True)
f, g, h = symbols('f g h', cls=Function)
init_printing()
To run a cell: Shift+Enter.
To print:
Cell > Run All.
Make sure no there is no error.
File -> Print Preview.
Print your name using print function.
Example: print("Ali bin Ahmad")
In [5]:
Print your student id using print function.
In [5]:
Print your group using print function.
In [5]:
Sketch the graph of �(�)=�3−�.
Define function f.
Example: f = x + 4
In [5]:
x-intercepts. When �=0, �=?
Use function solve (Sympy Docs https://docs.sympy.org/latest/modules/solvers/solvers.html#solvers).
In [5]:
x-intercept:
Answer:
y-intercepts. When �=0, �=?
Use function subs (Sympy Docs https://docs.sympy.org/latest/tutorial/basic_operations.html#substitution).
In [5]:
y-intercept:
Answer:
Critical Value(s)
Find the first derivative, �′(�), and assign it to variable called f1.
Use function diff (Sympy Docs https://docs.sympy.org/latest/tutorial/calculus.html#derivatives).
Print f1 using function pprint (Sympy Docs https://docs.sympy.org/latest/tutorial/printing.html#ascii-
pretty-printer).
In [5]:
Make the denominator the same using together function. Assign the result back to function f1. Print f1
using pprint.
Use function together (Sympy
Docs https://docs.sympy.org/latest/modules/polys/reference.html#manipulation-of-rational-functions).
In [5]:
Solve �′(�)=0.
Use function solve.
In [5]:
But, the function does not exist if the denominator is equal to zero.
Solve for the denominator equal to zero.
Use function solve.
In [5]:
Critical value:
Answer:
Interval of decreasing/increasing.
$f'(x
In [5]:
The function is
Answer:
�′(�>�)
In [5]:
The function is
Answer:
Maximum or Minimum point
Find the second derivative, �″(�), and assign it to variable called f2. Print f2.
In [5]:
Find the value of �″ at the critical value.
Note: zoo means undefined.
In [5]:
Extremum point:
Answer:
Concavity
Solve the second derivative equation for �.
Use function solve.
In [5]:
�″(�<�)
Use function subs.
In [5]:
The function is
Answer:
�″(�>�)
In [5]:
The function is
Answer:
Horizontal Aymptote
Limit as f approaches positive infinity.
Use limit function (Sympy Docs https://docs.sympy.org/latest/tutorial/calculus.html#limits).
In [5]:
Limit as f approaches negative infinity.
Use limit function (Sympy Docs https://docs.sympy.org/latest/tutorial/calculus.html#limits).
In [5]:
Horizontal asymptote:
Answer:
Vertical Asymptote
Limit from the left and the right of the critical value that comes from where the function is undefined.
Limit from left.
Use limit function.
In [5]:
Limit from right.
Use limit function.
In [5]:
Plot the function
Use function plot to plot the function (Sympy Docs https://docs.sympy.org/latest/modules/plotting.html).
Set the limit for y-axis from -10 to 10 by adding ylim parameter.
In [10]:
In [6]: