MATLABREPORT
MATLABREPORT
LAB WORK ON
MATHEMATICS – II
This report wouldn’t have been possible without the support and guidance of
these remarkable individuals. I am sincerely thankful to each and every one of
them for their assistance and unwavering support.
1
Introduction to MATLAB
MATLAB is an interactive matrix-based system for scientific and engineering
numerical computation as well as visualization. is a programming language and
development environment that is widely used in engineering, science, and
mathematics. It was created by MathWorks in the 1980s and has since become a
popular tool for numerical computation, data analysis, and visualization.
Arithmetic Operations:
Operations Meaning
+ Addition
- Subtraction
* Multiplication
/ Right Division
\ Left Division
^ Power
' Transpose
Built in Function:
Command Function
abs( ) Absolute value
exp( ) Exponential function
sqrt( ) Square root
log( ) Logarithmic function
Trigonometric Function:
Command Function
Sin( ) Sine
Cos( ) Cosine
Tan( ) Tangent
Csc( ) Cosecant
Sec( ) Secant
Cot( ) Cotangent
2
TABLE OF CONTENT
Experiment Practice date Submission
Date
1. Limit and Continuity 1st oct, 2023
13th oct,2023
iii. Simpson’s 1/3 Rule
16th oct,2023
iv. Simpson’s 3/8 Rule
4. Computational method
21st nov, 2023
i. Linear programming
26th nov,2023
iii. Newton-Raphson method
3
Experiment no. 1:
Limit and Continuity
Limit is the fundamental concept of calculus. In real sense, calculus is the study
of limits. It was developed by Sir Isaac Newton and Gottfried Wilhelm Leibnitz.
Let f(x) be defined on an open interval about a, expect possibly it a itself. If f(x)
gets arbitrarily close to L for all x sufficiently close to a, we say that f
approaches the limit L as x approaches a, and we write (𝑥) = L.
Example 1: Evaluate (2𝑥 + 5) .
INPUT: OUTPUT:
7𝑥2 +4𝑥
Example 2: Evaluate .
𝑥
INPUT: OUTPUT:
4
√𝑥2 +8−3
Example 3: Evaluate .
𝑥+1
INPUT: OUTPUT:
√𝑥2 +1
Example 4: Evaluate .
𝑥+1
INPUT: OUTPUT:
𝑥 𝑡𝑎𝑛(𝑎)−𝑎 𝑡𝑎𝑛(𝑥)
Example 5: Evaluate .
𝑥−𝑎
INPUT: OUTPUT:
5
Experiment no. 2:
Differentiation
The process of finding the derivative is called differentiation. The differential
calculus deals with the problem of finding instantaneous rate of change of a
function. To determine the slope of a tangent line at an arbitrary point on a
curve is the origin of derivative in geometrical sense. There are many ways to
denote derivative of a function y=f(x). The most common notations are f `(x),
𝑑𝑦 𝑑𝑓 𝑑
y`, , , 𝑓(𝑥).
𝑑𝑥 𝑑𝑥 𝑑𝑥
𝑑𝑦
Example 1: Find : 2x+5
𝑑𝑥
INPUT: OUTPUT:
𝑑𝑦 1
Example 2: Find :
𝑑𝑥 √𝑥
INPUT: OUTPUT:
6
𝑑𝑦 𝑥4 +1
Example 3: Find :
𝑑𝑥 𝑥2 +1
INPUT: OUTPUT:
𝑑𝑦
Example 4: Find : √𝑠𝑒𝑐(𝑥)
𝑑𝑥
INPUT: OUTPUT:
𝑑𝑦
Example 5: Find : cos(6x) cos(2x)
𝑑𝑥
INPUT: OUTPUT:
7
𝑑𝑦
Example 6: Find : ln(3x-2)
𝑑𝑥
INPUT: OUTPUT:
𝑑𝑦 𝑙𝑛(𝑥)
Example 7: Find :
𝑑𝑥 𝑐𝑜𝑠 𝑥
INPUT: OUTPUT:
𝑑𝑦
Example 8: Find : 𝑒 2𝑥+3
𝑑𝑥
INPUT: OUTPUT:
8
Experiment no. 3:
Integration And its Application
The reverse process of differentiation is antiderivative or integration. To find
the area between curves and coordinate axes, the integral calculus was
developed.
A function F(x) is antiderivative of a function f(x) if F`(x)=f(X) for all x in the
domain of f. the set of all antiderivatives if f is the indefinite integral of f with
respect to x, denoted by
∫ 𝑓(𝑋) dx
i. Simple integrations:
Example 1: Integrate: ∫ 𝑥 5 dx
INPUT: OUTPUT:
INPUT: OUTPUT:
9
3𝑥+1
Example 3: Integrate: ∫ dx
𝑥−2
INPUT: OUTPUT:
1
Example 6: Integrate: ∫0 (𝑥 2 + 5) dx
INPUT: OUTPUT:
10
ii. Trapezoidal Rule:
1 𝑑𝑥
Example 7: ∫0 , n=2
1+𝑥2
INPUT: OUTPUT:
𝜋
Example 8: ∫0 𝑠𝑖𝑛(𝑥) 𝑑𝑥 , n=4
INPUT: OUTPUT:
11
iii. Simpson’s 1/3 rule:
1 𝑑𝑥
Example 9: ∫0 dx, n=4
1+𝑥2
INPUT: OUTPUT:
0.2
Example 10: ∫0 √1 − 2𝑥 2 𝑑𝑥 , n=4
INPUT: OUTPUT:
12
iv. Simpson’s 3/8 rule:
𝜋
Example 11: ∫0 𝑠𝑖𝑛(𝑥) 𝑑𝑥 , n=3
INPUT: OUTPUT:
1 𝑑𝑥
Example 12: ∫0 dx, n=6
1+𝑥2
INPUT: OUTPUT:
13
Experiment no. 4:
Computational Method
i. Linear programming
Example 1: Max f= 7x+5y , subject to x+2y<=6,4x+3y<=6,x>=0,y>=0
INPUT: OUTPUT:
14
ii. Bisection method
15
iii. Newton-Raphson method
Example 4: Find the root of the equation 2𝑥 3 − 3𝑥 − 1 = 0 taking x0=1 with
error less than 0.0001.
INPUT: OUTPUT:
16
iv. Inverse Matrix method
17