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

Week 1 Matlab

The document outlines a MATLAB program designed to compute and visualize the partial derivative of a two-variable function f(x,y) with respect to x at a specified point (x1,y1). It includes mathematical formulations for the partial derivative and tangent line, as well as MATLAB syntax for implementation. The output consists of a surface plot of the function and a tangent line representing local changes in the function at the given point.

Uploaded by

suba kumari
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Week 1 Matlab

The document outlines a MATLAB program designed to compute and visualize the partial derivative of a two-variable function f(x,y) with respect to x at a specified point (x1,y1). It includes mathematical formulations for the partial derivative and tangent line, as well as MATLAB syntax for implementation. The output consists of a surface plot of the function and a tangent line representing local changes in the function at the given point.

Uploaded by

suba kumari
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

PROBLEM-1

1. Write a MATLAB program to compute and visualize the partial derivative of a two-variable function
f(x,y) with respect to x, and plot its tangent plane at a given point (x1,y1)..

AIM
To compute the partial derivative of a two-variable function f(x,y) with respect to x at a given point and
visualize the surface along with the tangent line in MATLAB.
MATHEMATICAL FORMULATION
Given a function f(x,y), the partial derivative with respect to x at a point (x1,y1) is calculated as:

The tangent line equation at the point is:

SYNTAX WITH DESCRIPTION


 syms x y: Declares symbolic variables x and y.
 z = input('Enter the two-dimensional function f(x,y): '): Prompts the user to input a two-
variable function.
 subs(z, x, x1): Substitutes the value x= x1 in the function.
 diff(z, x): Differentiates the function with respect to x.
 surf(x2, y2, z2): Visualizes the surface.
 line(x3, y3, z3): Plots the tangent line.
MATLAB CODING

OUTPUT
 Surface plot: A plot of the surface of f(x,y) around the point (x1,y1).
 Tangent line: A line representing the tangent to the surface at (x1,y1) based on the computed
partial derivative.
INFERENCE
This MATLAB program computes the partial derivative of a two-variable function with respect to x and
visualizes the tangent plane at the given point. The tangent line reflects how the function changes locally
with small variations in x, giving insight into the function's behaviour at that point.

You might also like