Analyzing real-valued functions

SymPy contains a rich calculus toolbox to analyze real-valued functions: limits, power series, derivatives, integrals, Fourier transforms, and so on. In this recipe, we will show the very basics of these capabilities.

How to do it...

  1. Let's define a few symbols and a function (which is just an expression depending on x):
    >>> from sympy import *
        init_printing()
    >>> var('x z')
    How to do it...
    >>> f = 1 / (1 + x**2)
  2. Let's evaluate this function at 1:
    >>> f.subs(x, 1)
    How to do it...
  3. We can compute the derivative of this function:
    >>> diff(f, x)
  4. What is 's limit ...

Get IPython Interactive Computing and Visualization Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.