• No results found

A table of derivatives and anti-derivatives

N/A
N/A
Protected

Academic year: 2021

Share "A table of derivatives and anti-derivatives"

Copied!
2
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

A table of derivatives and anti-derivatives

This example is based upon a nice example in the Pythontex gallery, see https://github.com/gpoore/pythontex/. It uses a tagged block to capture the Sympy output for later use in the body of the LaTeX table.

1 from sympy import * 2

3 var(’x’) 4

5 # Create a list of functions to include in the table

6 funcs = [[’sin(x)’,r’\\’], [’cos(x)’,r’\\’], [’tan(x)’,r’\\’],

7 [’asin(x)’,r’\\[5pt]’], [’acos(x)’,r’\\[5pt]’], [’atan(x)’,r’\\[5pt]’],

8 [’sinh(x)’,r’\\’], [’cosh(x)’,r’\\’], [’tanh(x)’,r’ ’]]

9

10 # pyBeg (CalculusTable) 11 for func, eol in funcs:

12 myddx = ’Derivative(’ + func + ’, x)’ 13 myint = ’Integral(’ + func + ’, x)’

14 print(latex(eval(myddx)) + ’&=’ + latex(eval(myddx + ’.doit()’)) + r’\quad & \quad’) 15 print(latex(eval(myint)) + ’&=’ + latex(eval(myint + ’.doit()’)) + eol)

16 # pyEnd (CalculusTable)

\begin{align*}

(2)

d dxsin (x) = cos (x) Z sin (x) dx = − cos (x) d dxcos (x) = − sin (x) Z cos (x) dx = sin (x) d dxtan (x) = tan 2(x) + 1 Z

tan (x) dx = − log (cos (x)) d dxasin (x) = 1 √ −x2+ 1 Z asin (x) dx = x asin (x) +√−x2+ 1 d dxacos (x) = − 1 √ −x2+ 1 Z acos (x) dx = x acos (x) −√−x2 + 1 d dxatan (x) = 1 x2+ 1 Z

atan (x) dx = x atan (x) − log (x

2+ 1) 2 d dxsinh (x) = cosh (x) Z sinh (x) dx = cosh (x) d dxcosh (x) = sinh (x) Z cosh (x) dx = sinh (x) d dxtanh (x) = − tanh 2 (x) + 1 Z

tanh (x) dx = x − log (tanh (x) + 1)

Referenties

GERELATEERDE DOCUMENTEN

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero,

either duplex printing or printing two pages on one side of a sheet of paper with blank back side).. (These are the

Since PythonTEX runs Python code (and potentially other code) on your computer, documents using PythonTEX have a greater potential for security risks than do standard L A

Because the compilation time for this example is usually quite short, option timer is not demonstrated very

- negative Arabic numbers turned into upper-case Roman numbers (although historically there were no negative Roman numbers): \Romanbar{-12} prints -XII. - zero Arabic number

(Or move the table in the source code near the position where it floats to or use the optional footnote marks.).. Table 5 (page 6) uses float specifier H from the float package and

(In that case the thumb marks column change will occur at another point, of course.) With paper format equal to document format the document can be printed without adapting the

This example demonstrates the use of package undolabl, v1.0l as of 2015/03/29 (HMM)!. For details please see