getting-started-with-symbolics/slides.tex
author bhanu
Mon, 15 Nov 2010 14:40:49 +0530
changeset 499 fff4a90b2310
parent 458 9a1c5d134feb
permissions -rw-r--r--
Language check done for `least square fit`

% Created 2010-11-11 Thu 02:03
\documentclass[presentation]{beamer}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{soul}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{hyperref}
\tolerance=1000
\usepackage[english]{babel} \usepackage{ae,aecompl}
\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
\usepackage{listings}
\lstset{language=Python, basicstyle=\ttfamily\bfseries,
commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
showstringspaces=false, keywordstyle=\color{blue}\bfseries}
\providecommand{\alert}[1]{\textbf{#1}}

\title{Getting started with symbolics}
\author{FOSSEE}
\date{}

\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
\begin{document}

\maketitle









\begin{frame}
\frametitle{Outline}
\label{sec-1}

\begin{itemize}
\item Defining symbolic expressions in sage.
\item Using built-in constants and functions.
\item Performing Integration, differentiation using sage.
\item Defining matrices.
\item Defining Symbolic functions.
\item Simplifying and solving symbolic expressions and functions.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Question 1}
\label{sec-2}

\begin{itemize}
\item Define the following expression as symbolic
    expression in sage.

\begin{itemize}
\item x$^2$+y$^2$
\item y$^2$-4ax
\end{itemize}

\end{itemize}

  
\end{frame}
\begin{frame}[fragile]
\frametitle{Solution 1}
\label{sec-3}

\lstset{language=Python}
\begin{lstlisting}
var('x,y')
x^2+y^2

var('a,x,y')
y^2-4*a*x
\end{lstlisting}
\end{frame}
\begin{frame}
\frametitle{Question 2}
\label{sec-4}


\begin{itemize}
\item Find the values of the following constants upto 6 digits  precision

\begin{itemize}
\item pi$^2$
\item euler$_{\mathrm{gamma}}$$^2$
\end{itemize}

\end{itemize}

\begin{itemize}
\item Find the value of the following.

\begin{itemize}
\item sin(pi/4)
\item ln(23)
\end{itemize}

\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Solution 2}
\label{sec-5}

\lstset{language=Python}
\begin{lstlisting}
n(pi^2,digits=6)
n(sin(pi/4))
n(log(23,e))
\end{lstlisting}
\end{frame}
\begin{frame}
\frametitle{Question 3}
\label{sec-6}

\begin{itemize}
\item Define the piecewise function. 
   f(x)=3x+2 
   when x is in the closed interval 0 to 4.
   f(x)=4x$^2$
   between 4 to 6.
\item Sum  of 1/(n$^2$-1) where n ranges from 1 to infinity.
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Solution 3}
\label{sec-7}

\lstset{language=Python}
\begin{lstlisting}
var('x') 
h(x)=3*x+2 
g(x)= 4*x^2
f=Piecewise([[(0,4),h(x)],[(4,6),g(x)]],x)
f
\end{lstlisting}

\lstset{language=Python}
\begin{lstlisting}
var('n')
f=1/(n^2-1) 
sum(f(n), n, 1, oo)
\end{lstlisting}
\end{frame}
\begin{frame}
\frametitle{Question 4}
\label{sec-8}

\begin{itemize}
\item Differentiate the following.

\begin{itemize}
\item sin(x$^3$)+log(3x), to the second order
\item x$^5$*log(x$^7$), to the fourth order
\end{itemize}

\item Integrate the given expression

\begin{itemize}
\item x*sin(x$^2$)
\end{itemize}

\item Find x

\begin{itemize}
\item cos(x$^2$)-log(x)=0
\item Does the equation have a root between 1,2.
\end{itemize}

\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Solution 4}
\label{sec-9}

\lstset{language=Python}
\begin{lstlisting}
var('x')
f(x)= x^5*log(x^7) 
diff(f(x),x,5)

var('x')
integral(x*sin(x^2),x) 

var('x')
f=cos(x^2)-log(x)
find_root(f(x)==0,1,2)
\end{lstlisting}
\end{frame}
\begin{frame}
\frametitle{Question 5}
\label{sec-10}

\begin{itemize}
\item Find the determinant and inverse of :

      A=[[x,0,1][y,1,0][z,0,y]]
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Solution 5}
\label{sec-11}

\lstset{language=Python}
\begin{lstlisting}
var('x,y,z')
A=matrix([[x,0,1],[y,1,0],[z,0,y]])
A.det()
A.inverse()
\end{lstlisting}
\end{frame}
\begin{frame}
\frametitle{Summary}
\label{sec-12}

\begin{itemize}
\item We learnt about defining symbolic expression and functions.
\item Using built-in constants and functions.
\item Using <Tab> to see the documentation of a function.
\item Simple calculus operations .
\item Substituting values in expression using substitute function.
\item Creating symbolic matrices and performing operation on them .
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Thank you!}
\label{sec-13}

  \begin{block}{}
  \begin{center}
  This spoken tutorial has been produced by the
  \textcolor{blue}{FOSSEE} team, which is funded by the 
  \end{center}
  \begin{center}
    \textcolor{blue}{National Mission on Education through \\
      Information \& Communication Technology \\ 
      MHRD, Govt. of India}.
  \end{center}  
  \end{block}
\end{frame}

\end{document}