Common Python Code

Author: John J Weber III, PhD

Grouping Symbols

There is at least one different grouping symbols:

SymPy Python Library

To import the complete SymPy library:

from sympy import *

NOTE: The above line of code is needed only once to input the SymPy functions listed below.

NOTE: The above line of code will always be provided, as well as any additional functions from other Python libraries.

Variables

To declare one variable:

x = symbols(x)

To declare two variables:

x, y = symbols(x, y)

To declare one variable and one parameter:

x, a = symbols(x, a)

Trigonometric Functions

Where x is in radians:

NOTE: To raise a trig function to a power, e.g., sin2(x): sin(x)**2

Inverse Trigonometric Functions

Output is in radians:

Logarithmic Functions

Exponential Function

Radical Functions

Absolute Value Functions

Implicit Multiplication

Exponents

Constants

Hyperbolic Functions

Inverse Hyperbolic Functions

CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License [http://creativecommons.org/licenses/by-nc-sa/4.0/].

Created: Monday, 23 November 2020 6:16 EDT Last Modified: Friday, 07 January 2022 - 15:33 (EST)