%hameed Ur Rehman %MSC 4 %assingment 4 %question 1
This MATLAB code defines a function f(x) as x*cos(x)^2 + 1, then calculates the integral of f from 0 to pi and stores it in y. It outputs the integral y in symbolic form as (pi*(pi + 4))/4 and numerically evaluates it to be approximately 5.6090.
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 ratings0% found this document useful (0 votes)
36 views1 page
%hameed Ur Rehman %MSC 4 %assingment 4 %question 1
This MATLAB code defines a function f(x) as x*cos(x)^2 + 1, then calculates the integral of f from 0 to pi and stores it in y. It outputs the integral y in symbolic form as (pi*(pi + 4))/4 and numerically evaluates it to be approximately 5.6090.