0% found this document useful (0 votes)
61 views

Symbolic Programming Code in Python

This document demonstrates various mathematical operations using the sympy Python library including differentiation, integration, solving equations, expanding and factoring expressions, working with matrices, and finding eigenvectors. It shows how to define symbols, perform differentiation and integration, solve sets and systems of equations, expand and simplify expressions, factor polynomials, check satisfiability, define and manipulate matrices through addition and multiplication, and find eigenvalues.

Uploaded by

xlntyogesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

Symbolic Programming Code in Python

This document demonstrates various mathematical operations using the sympy Python library including differentiation, integration, solving equations, expanding and factoring expressions, working with matrices, and finding eigenvectors. It shows how to define symbols, perform differentiation and integration, solve sets and systems of equations, expand and simplify expressions, factor polynomials, check satisfiability, define and manipulate matrices through addition and multiplication, and find eigenvalues.

Uploaded by

xlntyogesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

import sympy as sym

x=sym.Symbol('x')
y=sym.Symbol('y')
#differentiation
print(sym.diff(x**5))
#integration
print(sym.integrate((3*x**4+4*x**3+4*x),(x,1,3)))
#solve expression
sol=sym.solveset(x**2+x-12,x)
print(sol)
sol=sym.solve((x+5*y-2,-3*x+6*y-15),(x,y))
print(sol)
#expand
expr = (x + 1) ** 2
print(sym.expand(expr))
#simplify
print(sym.simplify((x + x * y) / x))
#factors
f=x**4-3*x**2+1
print(sym.factor(f))
print(sym.satisfiable(x & y))
#matrix
m1 = sym.Matrix([[1,2,3],[4,5,6],[7,8,9]])
m2 = sym.Matrix([[9,8,7],[6,5,4],[3,2,1]])
print(m1)
#addition of two matrix
sym.pprint(m1+m2)
#multiplication
sym.pprint(m1*m2)
#eigen vectors
eg=sym.Matrix.eigenvals(m1)
print(eg)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy