HugoHuynh - Brainlyassets.openstudy.com/...1417131415581-hugohuynh.pdf · In[2]:= Plot@g@xD, 8x,...
Transcript of HugoHuynh - Brainlyassets.openstudy.com/...1417131415581-hugohuynh.pdf · In[2]:= Plot@g@xD, 8x,...
http://openstudy.com/study#/updates/5477a78de4b0de37d41bc8a7
In[7]:= Clear@"Global`*"D; $Line = 0;
Make the polynomial a temporary Mathematica function.
In[1]:= g@x_D := x3
+ 5 x2
- 17 x - 21
In[2]:= Plot@g@xD, 8x, -9, 7<D
Out[2]=
-5 5
-200
-100
100
200
Set the partial derivative of g(x) to zero and solve the result for x.
In[3]:= ¶x Hg@xDL � 0 �� Solve �� Flatten
Out[3]= :x ®
1
3
I-5 - 2 19 M, x ®
1
3
I-5 + 2 19 M>
Ask Mathematica to convert the above to their numeric values.
% refers to the last Mathematica calculation result, Out[3] in this case.
In[4]:= % �� N
Out[4]= 8x ® -4.5726, x ® 1.23927<
Plug in the first symbolic solution for x from Out[3], into g(x), and then simplify the
result. ® expressions are replacement rules and /. is the replacement operator.
In[5]:= g@x �. %3@@1DD
D �� Simplify
Out[5]=
16
27
I28 + 19 19 M
The above calculated to 50 digits. Mathematica is capable of unlimited precision
arithematic.
In[6]:= N@%, 50D
Out[6]= 65.670565882828324440001574929382339273246266417432