Saturday, October 10, 2015

Zebra Tacos

Zebra Tacos

The Crocodile Maths Problem

In [1]:
from sympy import *
init_printing(use_latex='mathjax')
x=symbols("x")
In [2]:
T=5*(36+x**2)**(0.5)+4*(20-x)
T
Out[2]:
$$- 4 x + 5 \left(x^{2} + 36\right)^{0.5} + 80$$
In [3]:
%matplotlib inline
plot(T,(x,0,20))
Out[3]:
<sympy.plotting.plot.Plot at 0x3c835c0>
In [4]:
Tprime=diff(T,x)
Tprime
Out[4]:
$$\frac{5.0 x}{\left(x^{2} + 36\right)^{0.5}} - 4$$
In [5]:
solve(Tprime,x)
Out[5]:
$$\left [ 8.0\right ]$$
In [6]:
T.subs(x,8.0)
Out[6]:
$$98.0$$
Resources