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

MATLABREPORT

The document is a lab report on Mathematics II submitted by Aayush Maharjan to Prabesh Adhikari at Swoyambhu International College. It includes acknowledgments, an introduction to MATLAB, and outlines various mathematical experiments such as limits, differentiation, integration, and computational methods. Each section provides examples and input/output for different mathematical operations and techniques.

Uploaded by

Aayush Mhrz'n
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)
32 views

MATLABREPORT

The document is a lab report on Mathematics II submitted by Aayush Maharjan to Prabesh Adhikari at Swoyambhu International College. It includes acknowledgments, an introduction to MATLAB, and outlines various mathematical experiments such as limits, differentiation, integration, and computational methods. Each section provides examples and input/output for different mathematical operations and techniques.

Uploaded by

Aayush Mhrz'n
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/ 18

TRIBHUWAN UNIVERSITY

SWOYAMBHU INTERNATIONAL COLLEGE


Lagankhel, Lalitpur
Contact no.: +97715455970

LAB WORK ON
MATHEMATICS – II

SUBMITTED BY: SUBMITTED TO:


AAYUSH MAHARJAN PRABESH ADHIKARI
BCA 2nd LECTURER/SUPERVISOR
ROLL NO: 03 DEPARTMENT OF
MATHEMATICS
SWOYAMBHU IN’T COLLEGE
Acknowledgement
I extend my sincere gratitude to all individuals who have contributed to the
completion of this report. I want to begin by thanking Swoyambhu International
College and the Department of Mathematics at SIC for providing an excellent
platform for learning, along with the necessary resources and a conducive
environment.

I am especially thankful to Mr. Prabesh Adhikari, our supervisor/lecturer, whose


guidance, discussions, and invaluable feedback were instrumental in seeing this
project through from its inception to its completion. I am grateful to all the
respondents for their valuable input.

I would like to express my deepest appreciation to my parents and brother for


their unwavering support—financially, emotionally, and morally—throughout
my educational journey. Special thanks also go to my friends—Roshan Shakya,
Ronish Maharjan, Bibek Shenchuri, Raman Shakya and Samyak Shakya—for
their constant encouragement during this project.

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

2. Differentiation 4th oct, 2023

3. Integration and its Application

i. Simple integrations 8th oct, 2023

ii. Trapezoidal Rule 10th 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

24th nov, 2023


ii. Bisection method

26th nov,2023
iii. Newton-Raphson method

29th nov, 2023


iv. Inverse Matrix 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`, , , 𝑓(𝑥).
𝑑𝑥 𝑑𝑥 𝑑𝑥

Let y=f(x) be a function. If ∆𝑦 be an increment in y corresponding to an


∆𝑦
increment ∆𝑥 in x, then ∆𝑥 , if exists, is called derivative of y with respect to x
𝑑𝑦
and is denoted by .
𝑑𝑥

The process of finding differential coefficient or derivative from this method is


known as the method of differentiation from the definition or the first principle.

𝑑𝑦
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

The symbol ∫ . is an integral sign.


The function f is the integrand of the integral and x is the variable of integration.

i. Simple integrations:
Example 1: Integrate: ∫ 𝑥 5 dx
INPUT: OUTPUT:

Example 2: Integrate: ∫ (7𝑥 − 2)3 dx

INPUT: OUTPUT:

9
3𝑥+1
Example 3: Integrate: ∫ dx
𝑥−2

INPUT: OUTPUT:

Example 4: Integrate: ∫ 𝑐𝑜𝑠 2 𝑥 dx


INPUT: OUTPUT:

Example 5: Integrate: ∫ 𝑒 2𝑥+3 dx


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

Computational methods revolutionize mathematical problem-solving,


offering solutions to complex problems through numerical approximations,
linear algebra computations, function approximations, and optimization
techniques. MATLAB serves as a powerful ally, providing a diverse range of
tools and functions for these computations.

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

Example 2: Find the root of the equation 𝑥 3 − 2𝑥 − 5 = 0 lying between 2 and


3 correct to 3 decimal places with error less than 0.001.
INPUT: OUTPUT:

Example 3: Find the root of the equation 2𝑥 3 − 5𝑥 + 2 = 0 lying between 1


and 2 correct to 3 decimal places with error less than 0.001.
INPUT: OUTPUT:

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:

Example 5: Find the root of the equation 𝑥 3 − 𝑥 − 4 = 0 between 1 and 2 to


three places of decimal.
INPUT: OUTPUT:

16
iv. Inverse Matrix method

Example 6: Solve: x+y+z=9;2x+5y+7z=52;2x+y-z=0


INPUT: OUTPUT:

Example 7: Solve: x-2y-z=1;x-y+2z=9;2x-3y-z=4


INPUT: OUTPUT:

17

You might also like