In [1]:
%matplotlib notebook
#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:
Print your name using print function.
Example: print("Ali bin Ahmad")
In [ ]:
Print your student id using print function.
In [ ]:
Define function f.
Example: f = x + 4
In [ ]:
x-intercepts. When $y=0$, $x=?$
Use function solve (Sympy Docs pg. 1462).
In [ ]:
x-intercept:
Answer:
y-intercepts. When $x=0$, $y=?$
Use function subs (Sympy Docs pg. 15).
In [ ]:
y-intercept:
Answer:
Find the first derivative, $f'(x)$, and assign it to variable called f1.
Use function diff (Sympy Docs pg. 37).
Print f1 using function pprint (Sympy Docs pg. 22).
In [ ]:
Make the denominator the same using together function. Assign the result back to function f1. Print f1 using pprint.
Use function together (Sympy Docs pg. 23).
In [ ]:
Solve $f'(x)=0$.
Use function solve (Sympy Docs pg. 1462).
In [ ]:
But, the function does not exist if the denominator is equal to zero.
Solve for the denominator equal to zero.
Use function solve (Sympy Docs pg. 1462).
In [ ]:
Critical value:
Answer:
$f'(x<c)$
In [ ]:
The function is
Answer:
$f'(x>c)$
In [ ]:
The function is
Answer:
Find the second derivative, $f''(x)$, and assign it to variable called f2. Print f2.
In [ ]:
Find the value of $f''$ at the critical value.
Note: zoo means undefined.
In [ ]:
Extremum point:
Answer:
Solve the second derivative equation for $x$.
Use function solve (Sympy Docs pg. 1462).
In [ ]:
$f''(x < c)$
Use function subs (Sympy Docs pg. 15).
In [ ]:
The function is
Answer:
$f''(x > c)$
In [ ]:
The function is
Answer:
Limit as f approaches positive infinity.
Use limit function (Sympy Docs pg. 41).
In [ ]:
Limit as f approaches negative infinity.
Use limit function (Sympy Docs pg. 41).
In [ ]:
Horizontal asymptote:
Answer:
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 (Sympy Docs pg. 41).
In [ ]:
Limit from right.
Use limit function (Sympy Docs pg. 41).
In [ ]:
Use function plot to plot the function (Sympy Docs pg. 1264).
Set the limit for y-axis from -6 to 10 by adding ylim parameter.
In [ ]: