Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Class notes 21CSC203P (APP)

Rating
-
Sold
-
Pages
35
Uploaded on
23-11-2025
Written in
2025/2026

This document contains the complete APP syllabus in clear, easy-to-understand notes. All units are explained in a structured format so you can study faster and score better. Included in this file: Full APP course coverage Unit-wise notes Important definitions & formulas Exam-focused explanations Short revision notes for quick study Clean and well-organized format Useful for assignments, tests, and semester exams These notes are perfect for students who want a complete, ready-to-study material without searching multiple sources. Simple language, neat presentation, and fully exam-oriented content. If you want to prepare the entire APP subject quickly and effectively, these notes are exactly what you need.

Show more Read less
Institution
Course

Content preview

Unit-5 notes

Symbolic programming: In computer programming, symbolic programming is
a programming paradigm in which the program can manipulate its own
formulas and program components as if they were plain data.
Through symbolic programming, complex processes can be developed that
build other more intricate processes by combining smaller units of logic or
functionality. Thus, such programs can effectively modify themselves and
appear to "learn", which makes them better suited for applications such
as artificial intelligence, expert systems, natural language processing, and
computer games.
Languages that support symbolic programming include languages such
as Wolfram Language, LISP and Prolog.
Symbolic programming paradigm is a symbolic computer algebra system. They
use symbolic in the mathematical sense. Some authors consider it as a part of
functional programming but it is very much different from that.
For example, if you do 1.0/3*3 in, say, C, it divides 1.0 by 3 and then multiplies
the result by 3 = (1.0/3)*3. You get 0.9999999999998.
Mathematica (and other symbolic mathematics software, for example
Macsyma/Maxima) treats numbers as symbols... Like, 1/3*3 is not a lot
different from a/b*b until you need the actual result in numeric form. Since
a/b*b is a, 1/3*3 is 1. No computation with actual numeric values needed.

Getting started with SymPy module: Sympy is a Python library for symbolic
mathematics. It aims to become a full-featured computer algebra system (CAS)
while keeping the code as simple as possible in order to be comprehensible and
easily extensible. SymPy is written entirely in Python.
SymPy only depends on mpmath, a pure Python library for arbitrary floating
point arithmetic, making it easy to use.

SymPy as a calculator:SymPy defines following numerical types: Rational and
Integer. The Rational class represents a rational number as a pair of two
Integers, numerator and denominator, so Rational(1, 2) represents 1/2,
Rational(5, 2) 5/2 and so on. The Integer class represents Integer number.
# import everything from sympy module
from sympy import *
a = Rational(5, 8)
print("value of a is :" + str(a))
b = Integer(3.579)
print("value of b is :" + str(b))
SymPy uses mpmath in the background, which makes it possible to perform
computations using arbitrary-precision arithmetic. That way, some special

,constants, like exp, pi, oo (Infinity), are treated as symbols and can be evaluated
with arbitrary precision.
# import everything from sympy module
from sympy import *
# you can't get any numerical value
p = pi**3
print("value of p is :" + str(p))
# evalf method evaluates the expression to a floating-point number
q = pi.evalf()
print("value of q is :" + str(q))
# equivalent to e ^ 1 or e ** 1
r = exp(1).evalf()
print("value of r is :" + str(r))
s = (pi + exp(1)).evalf()
print("value of s is :" + str(s))
rslt = oo + 10000
print("value of rslt is :" + str(rslt))
if oo > 9999999 :
print("True")
else:
print("False")
output:value of p is :pi^3
value of q is :3.14159265358979
value of r is :2.71828182845905
value of s is :5.85987448204884
value of rslt is :oo
True
The real power of a symbolic computation system such as SymPy is the ability
to do all sorts of computations symbolically. SymPy can simplify expressions,
compute derivatives, integrals, and limits, solve equations, work with matrices,
and much, much more, and do it all symbolically. Here is a small sampling of
the sort of symbolic power SymPy is capable of, to whet your appetite.
Example : Find derivative, integration, limits, quadratic equation.
# import everything from sympy module
from sympy import *
# make a symbol
x = Symbol('x')
# ake the derivative of sin(x)*e ^ x
ans1 = diff(sin(x)*exp(x), x)
print("derivative of sin(x)*e ^ x : ", ans1)
# Compute (e ^ x * sin(x)+ e ^ x * cos(x))dx
ans2 = integrate(exp(x)*sin(x) + exp(x)*cos(x), x)
print("indefinite integration is : ", ans2)

,# Compute definite integral of sin(x ^ 2)dx
# in b / w interval of ? and ?? .
ans3 = integrate(sin(x**2), (x, -oo, oo))
print("definite integration is : ", ans3)
# Find the limit of sin(x) / x given x tends to 0
ans4 = limit(sin(x)/x, x, 0)
print("limit is : ", ans4)
# Solve quadratic equation like, example : x ^ 2?2 = 0
ans5 = solve(x**2 - 2, x)
print("roots are : ", ans5)
output: derivative of sin(x)*e^x : exp(x)*sin(x) + exp(x)*cos(x)
indefinite integration is : exp(x)*sin(x)
definite integration is : sqrt(2)*sqrt(pi)/2
limit is : 1
roots are : [-sqrt(2), sqrt(2)]

sympy.Derivative() method: With the help of sympy.Derivative() method, we
can create an unevaluated derivative of a SymPy expression. It has the same
syntax as diff() method. To evaluate an unevaluated derivative, use the doit()
method.
Syntax: Derivative(expression, reference variable)
Parameters:
expression – A SymPy expression whose unevaluated derivative is found.
reference variable – Variable with respect to which derivative is found.
# import sympy
from sympy import *
x, y = symbols('x y')
expr = x**2 + 2 * y + y**3
print("Expression : {} ".format(expr))
# Use sympy.Derivative() method
expr_diff = Derivative(expr, x)
print("Derivative of expression with respect to x : {}".format(expr_diff))
print("Value of the derivative : {} ".format(expr_diff.doit()))
output: Expression : x**2 + y**3 + 2*y
Derivative of expression with respect to x : Derivative(x**2 + y**3 + 2*y, x)
Value of the derivative : 2*x
Example2:
# import sympy
from sympy import *
x, y = symbols('x y')
expr = y**2 * x**2 + 2 * y*x + x**3 * y**3
print("Expression : {} ".format(expr))

, # Use sympy.Derivative() method
expr_diff = Derivative(expr, x, y)
print("Derivative of expression with respect to x : {}".format(expr_diff))
print("Value of the derivative : {} ".format(expr_diff.doit()))
output: Expression : x**3*y**3 + x**2*y**2 + 2*x*y
Derivative of expression with respect to x : Derivative(x**3*y**3 + x**2*y**2
+ 2*x*y, x, y)
Value of the derivative : 9*x**2*y**2 + 4*x*y + 2

sympy.diff() method: With the help of sympy.diff() method, we can find the
differentiation of mathematical expressions in the form of variables by using
sympy.diff() method.
Syntax : sympy.diff(expression, reference variable)
Return : Return differentiation of mathematical expression.
Example:In this example we can see that by using sympy.diff() method, we can
find the differentiation of mathematical expression with variables. Here we use
symbols() method also to declare a variable as symbol.
# import sympy
from sympy import * x, y = symbols('x y')
gfg_exp = x + y
exp = sympy.expand(gfg_exp**2)
print("Before Differentiation : {}".format(exp))
# Use sympy.diff() method
dif = diff(exp, x)
print("After Differentiation : {}".format(dif))
Output :
Before Differentiation : x**2 + 2*x*y + y**2
After Differentiation : 2*x + 2*y

sympy.factor() method: With the help of sympy.factor() method, we can find
the factors of mathematical expressions in the form of variables by using
sympy.factor() method.
Syntax : sympy.factor(expression)
Return : Return factor of mathematical expression.
Example #1 :
In this example we can see that by using sympy.factor() method, we can find the
factors of mathematical expression with variables. Here we use symbols()
method also to declare a variable as symbol.
# import sympy
from sympy import expand, symbols, factor
x, y = symbols('x y')
gfg_exp = x + y
exp = sympy.expand(gfg_exp**2)

Written for

Institution
Course

Document information

Uploaded on
November 23, 2025
Number of pages
35
Written in
2025/2026
Type
Class notes
Professor(s)
Harshit mehta sir
Contains
All classes

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
nitin8

Get to know the seller

Seller avatar
nitin8 SRM Institute of Science and Technology
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
5 months
Number of followers
0
Documents
8
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions