using MTH229 plotly()
Plots.PlotlyBackend()
10^9 / 8 * 7 - 6 + 5
8.74999999e8
sin(pi/3) * sin(pi/4)^2 * asin(pi/5)
0.2941844678207861
cosd(75) - cos(75), cos(75*pi/180) - cos(75) ## either way
(-0.6629322246222286,-0.6629322246222286)
exp(1/2 * (3-1)^2)
7.38905609893065
*
$$~ \frac{\sin(x) + \cos(x)}{\sin(x) - \cos(x)}, \text{ when } x = 1. ~$$x = 1 (sin(x) + cos(x)) / (sin(x) - cos(x))
4.588037824983901
f(x) = sqrt(x / (x + 1)) f(1/2)
0.5773502691896257
f(x) = log(x + 1) - x f(1/2)
-0.09453489189183562
f(x) = acos(x) f(1/2)
1.0471975511965979
f(x) = x * (x-1) / (x -2) / (x-3)
. Are there vertical asymptotes? Is there a slant asymptote? Is there a horizontal asymptote?f(x) = x * (x-1) / (x -2) / (x-3) plot(f, -5, 5)
There are vertical asymptotes at $2$ and $3$
Plotting on a wider scale shows slant of horizontal asymptotes:
plot(f, -20, 20)
There is a horizontal asymptote $y=1$.
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?f(x) = cos(x) * cosh(x) g(x) = 1 plot([f,g], 1, 5)
There is clearly an answer out near $4.5$:
plot([f,g], 4.5, 5)
It is around $4.73$.
Is there a value near $1$?
plot([f,g], 1, 2)
Clearly none, now that we have resized our viewing window.
f(x) = sin(x) g(x) = x - x^3/6 plot([f,g], -pi/2, pi/2)
Hmm, hard to separate the two graphs.
Trying to plot the difference we have:
h(x) = f(x) - g(x) plot(h, -pi/2, pi/2)
We still can't tell. But if we knew the graph is increasing, then there can be only 1.
f(x) = x^5 - x + 1 plot(f, -5, 5)
Clearly, any decrease happens between $[-2,2]$. Here we regraph:
plot(f, -2, 2)
Looks like it decreases between $-1$ and $1$. (We will see later how to determine that the decrease happens between $[-0.66874, 0.66874]$.)
fzeros
to find the real roots of the polynomial $f(x) = x^5 - x + 1$.f(x) = x^5 - x + 1 fzeros(f)
1-element Array{Real,1}: -1.1673
There is just one, as we could tell from the previous graphs.
[a,b]
, and use fzero(f, [a,b])
to find the roots.f(x) = x^3 - 9x^2 + 26x - 24 plot(f, 0,6)
We can see one in $[3.5,4.5]$ which has the value:
fzero(f, 3.5, 4.5)
4.0
As for any more, we plot over $[1.8, 3.2]$ to look more closely:
plot(f, 1.8, 3.2)
We see $[1.8, 2.4]$ and $[2.4, 3.2]$ are bracketing intervals, so we have two more zeros returned by:
fzero(f, 1.8, 2.4), fzero(f, 2.4, 3.2)
(2.0,3.0)
f(x) = sin(x) - (x - x^3/6) fzeros(f, -pi/2, pi/2)
1-element Array{Float64,1}: -1.59446e-155
That answer is basically 0 – the mathematically precise answer.
fzeros
to find how many zeros there are for $f(x) = \sin(20\pi\cdot x)$ over $[0,1]$.f(x) = sin(20*pi*x) fzeros(f, 0, 1)
20-element Array{Float64,1}: 0.0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95
This is missing 1
, so there are $21$.