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.
~$$
*
$$~
\sin^2 \left(\frac{x - 2\pi}{x + 2\pi}\right) \text{ when } x = \pi/4.
~$$
Order of operations
Which of these three expressions will be different from the other two?
2 - 3 - 4
, (2-3)-4
, 2 - (3-4)
Integers can cause some issues.
Are these expressions identical
Floating point can cause small issues.
Are these expressions identical?
Defining functions
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)}$
*
$$~
f(x) = \begin{cases}
x^2 & x < 1\\
x & \text{otherwise}
\end{cases}
~$$
- A function describing the line that goes through the points $(-1,-\pi)$ and $(2,\pi)$.
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]$.
- Two phone plans are given as follows: Plan 1 is 40 dollars per month for the first 5Gb of data and 2 dollars additional for any additional data usage; Plan 2 is a flat rate of 75 dollars per month, unlimited data. Graphically find the "break-even" point.