0% found this document useful (0 votes)
149 views28 pages

University of Technology: Report Matlab Calculus 1

1. The document provides the theoretical basics and MATLAB code solutions for 10 calculus problems. It covers key MATLAB commands, derivatives, Taylor polynomials, and solving first and second order differential equations. 2. The handwritten solutions show the step-by-step working for Problems 1-10. The MATLAB code solutions then implement the same problems using code. 3. Key concepts covered include solving systems of equations, finding intersections of functions, calculating derivatives, approximating functions with Taylor polynomials, evaluating integrals, and solving various types of differential equations.

Uploaded by

Vu Anh
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)
149 views28 pages

University of Technology: Report Matlab Calculus 1

1. The document provides the theoretical basics and MATLAB code solutions for 10 calculus problems. It covers key MATLAB commands, derivatives, Taylor polynomials, and solving first and second order differential equations. 2. The handwritten solutions show the step-by-step working for Problems 1-10. The MATLAB code solutions then implement the same problems using code. 3. Key concepts covered include solving systems of equations, finding intersections of functions, calculating derivatives, approximating functions with Taylor polynomials, evaluating integrals, and solving various types of differential equations.

Uploaded by

Vu Anh
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/ 28

1

University of Technology
·▪•🙢🙞🕮🙜🙠•▪·

REPORT MATLAB
CALCULUS 1

Teacher : Lê Xuân Đại


Class :DTQ1
Topic : Group 5
Đoàn Hoài Nam 1752360
Trần Anh Vũ 1752630
Lê Nguyễn Hoàng Nhân 2052625
2

CONTENTS
❖ Theoretical basic.

❖ Handwriting solution.

❖ Matlab code solution.


3

THEORETICAL BASIC.

1. Some basic matlab commands :

- syms : data declaration.

- solve(f,x) : solve the equation f followed x variable.

- solve(f1,f2,x,y) : solve the equation f1 and f2 following x,y variables.

- x = a : 100 : b : in the x interval from a to, select 100 points.

- plot(x,f) : draw the function x followed x variable.

- title(‘’) : name the graph of the function.

- diff(x) : derivative of the equation f.

- int(f) : integral the equation f

- subs(f,a,b) : calculate the equation of from a to b.

- dsolve(f) : solve first order differential equations of f.

2. Derivative .

- A function of a real variable y = f(x) is differentiable at a point a of its

domain, if its domain contains an open interval I containing a, and the

limit.

3. Taylor.

- In mathematics, the Taylor series of a function is an infinite sum of terms


that are expressed in terms of the function's derivatives at a single point.
For most common functions, the function and the sum of its Taylor series
are equal near this point.
- The partial sum formed by the first n + 1 terms of a Taylor series is a
polynomial of degree n that is called the nth Taylor polynomial of the
function.
- The higher the order of Taylor polynomial, the more accurate the
approximation gets.
4

- How to calculate the Taylor polynomial?

- For example, we have We can visualize


the approximation with the graph:

-
- We can see that the polynomial follow the function very accurately, especially
around x = 0.
- In fact, the error of the above polynomial is no more than (|x|^9)/9!. In
particular, for −1 < x < 1, the error is less than 0.000003.
4. First order differential equations.

- In many fields such as physics, biology or business, a relationship is

often known or assumed between some unknown quantity and its rate

of change, which does not involve any higher derivatives. It is


5

therefore of interest to study first order differential equations in

particular.

- A first order differential equation is an equation of the form

5. Second order differential equations.

- A second-order ordinary differential equation is an ordinary

differential equation that may be written in the form

-
6

HANDWRITING SOLUTION.
1. Problem 1.
7

2. Problem 2.
8

3. Problem 3.

4. Problem 4.
9
10

5. Problem 5
11

6. Problem 6.

7. Problem 7.
12

8. Problem 8.
13

9. Problem 9
14

10. Problem 10.


15

MATLAB CODE SOLUTION.


1. Problem 1.
● Code and explaination.
- Input 2 equation ( f1, f2 ) which is given by problem
- Using code solve(f1,f2,x,y) to solve the system of 2 equations followed by x and y
variables.
- Using code S.x to show x.
- Using code vpa(Sx) to show decimal numbers of x.
16

● Result.
- we have three value of x (8, 22, 14). But x > 10. So we accpet two values of x
(22 and 14).
17

2. Problem 2.
● Code and explanation.
- Find the intersection of f(x) and g(x).
- Input the equation f = 5.^x - x.^5 to find the intersection.
- Using code solve(f) to solve the equation.
- Using code vpa(ans) to show answers in decimal numbers.
- We have one intersection point at x = 1.7 .

- Graphing both f and g in several viewing rectangles.


- the graph of function f(x) and g(x) from x = -2 to x = 0.
18

- the graph of function f(x) and g(x) from x = 0 to x = 2.

- the graph of function f(x) and g(x) from x = 2 to x = 5.


19

- the graph of function f(x) and g(x) from x = 5 to x =8 .

- the graph of function f(x) and g(x) from x = -2 to 10.


- using code x = -2:1/100:10 to pick up 100 point on interval x from -2 to 10.
- input function f(x) and g(x).
- using code plot(x,f,x,g) to draw the graph of f and g.
- using code gtext(‘f(x)’) to name the line of function f.
- using code gtext(‘g(x)’) to name the line of function g.
20

- All overall, we can see the function g(x) grows more rapidly when x is large.
● Result.
- We have two intersection points at x = 1.7 and x = 5 .
- All overall, we can see the function g(x) grows more rapidly when x is large.
21

3. Problem 3.
● Code and explanation.
- first, we sut up t = x^(1/3). At x = 0, t =0.
- Input the equation f
- Using code f1 = diff(f,1) to calculate the first order derivative of f.
- Using code subs(f1,0) to calculate the value of the first order derivative of f at t = 0.

● Result.
- The first order derivative of f at t = 0 is 0.
22

4. Problem 4.
● Code and explanation.
- Using code x = 0:1/100:1 to get 100 points in the interval from 0 to 1.
- input the equation f.
- using code plot(x,y) to graph of the function y against the variable x.
- using code title(‘Graph of the function y’) to name the graph.
- using code xlable(‘x’) and ylabel(‘y’) to name horizontal and vertical axis.

● Results.
23

5. Problem 5.
● Code and explanation.
- input the equation f.
- using code taylor(f,x,1,’Order’,2) to write down the Taylor polynomial of degree 2 for
f at x = 1.

● Results.
- the Taylor polynomial of degree 2 for f at x = 1 is x-2 .
24

6. Problem 6.
● Code and explanation.
- input the equation f.
- using code integral(fun,1,Inf) to calculate the integral of f from 1 to inf.

● Results.
- the integral of f from 1 to inf is 1,4437.
25

7. Problem 7.
● Code and explanation.
- input the equation f.
- using code int(y,1,4) to calculate the arc length of the portion of the curve.
- using code vpa(ans) to show the decimal numbers of the answer.

● Results.
- the arc length of the portion of the curve is 6,699.
26

8. Problem 8.
● Code and explanation.
- using code ode = diff(y) == (-3.*x-3.*y+1)/(2.*x+2.*y) to input the first oder
differential equations of y.
- using code cond = y(0) == 2 to input the condition y = 2 at x = 0.
- using code ySol(x) = dsolve(ode,cond) to solve the first order differential equation of
y at condition y(0)=2.

● Results.
27

9. Problem 9.
● Code and explanation.
- using code ode = diff(y,x,2)-4.*diff(y,x)+3.*y == sin(2.*x) to input the second order
differential equation.
- using code ySol(x) = dsolve(ode) to solve the equation.

● Results.
28

10. Problem 10.


● Code and explanation.
- using code ODEx = diff(x) == -x -2.*y+2.*exp(t) to input the first order differential
equation of x.
- using code ODEy = diff(y) == 3.*x+4.*y+exp(-t) to input the first order differential
equation of y.
- using code Solve = dsolve(ODEx,ODEy) to solve the system of 2 first order
differential equation.
- using code Solve.x to show x.
- using code Solve.y to show y.

● Results.

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