day1/session6.tex
changeset 379 682b6f66fe11
parent 378 2299700a8b97
child 382 41c34770d63a
--- a/day1/session6.tex	Fri Mar 05 23:59:12 2010 +0530
+++ b/day1/session6.tex	Mon Mar 08 20:45:33 2010 +0530
@@ -311,6 +311,25 @@
 \end{center}
 \end{frame}
 
+\begin{frame}[fragile]
+  \frametitle{Exercise Problem}
+  Find the root of the equation $x^2 - sin(x) + cos^2(x)$ nearest to $0$
+\end{frame}
+
+\begin{frame}[fragile]
+  \frametitle{Solution}
+  \begin{small}
+  \begin{lstlisting}
+    def f(x):
+        return x**2 - sin(x) + cos(x)*cos(x)
+    fsolve(f, 0)
+  \end{lstlisting}
+  \end{small}
+  \begin{center}
+\includegraphics[height=2in, interpolate=true]{data/fsolve_tanx}
+  \end{center}
+\end{frame}
+
 %% \begin{frame}[fragile]
 %% \frametitle{Scipy Methods \dots}
 %% \begin{small}