Some sample questions for test 1.
calculator
Evaluate each expression. For each, write the answer and the julia commands you used to produce the answer:
- $10^9 / 8 \cdot 7 - 6 + 5$
- $\sin(\pi/3) \cdot \sin^2(\pi/4) \cdot \sin^{-1}(\pi/5)$
- $\cos(75^\circ) - \cos(75)$
*
$$~
\frac{\sin(x) + \cos(x)}{\sin(x) - \cos(x)}, \text{ when } x = 1.
~$$
For each function, write a function in julia and compute $f(1/2)$. For each, your answer should have the command to define the function and the value at $1/2$.
- $f(x) = \sqrt{x / (x + 1)}$
Plotting
- Graph the function
f(x) = x * (x-1) / (x -2) / (x-3)
. Are there vertical asymptotes? Is there a slant asymptote? Is there a horizontal asymptote?
- Graph the function
f(x) = cos(x) * cosh(x)
between $[1, 5]$. Identify from the graph how many values of $x$ satisfy $f(x) = 1$ in $[1,5]$? What is the largest of them?
- Graph the functions $f(x) = \sin(x)$ and $g(x) = x - x^3/6$ over the interval $[-\pi/2, \pi/2]$. Can you tell how many times the two functions cross? Does it help to plot $\sin(x) - (x - x^3/6)$? Would it be helpful to know that $\sin(x) - (x - x^3/6)$ is increasing on this interval?
- For the function $f(x) = x^5 - x + 1$ identify any intervals where the function is decreasing within $[-5, 5]$.
Zeros
- Use
fzeros
to find the real roots of the polynomial $f(x) = x^5 - x + 1$.
- For the function $f(x) = x^3 - 9x^2 +26x - 24$ over the interval $[0,6]$ there are a few roots. For each, find a bracketing interval,
[a,b]
, and use fzero(f, [a,b])
to find the roots.
- Use a root-finding algorithm to identify how many times $\sin(x)$ and $x - x^3/6$ are equal within $[-\pi/2, \pi/2]$.
- Use
fzeros
to find how many zeros there are for $f(x) = \sin(20\pi\cdot x)$ over $[0,1]$.