f(x)=x^2+sin(x)+1/x
clear; close; clc;
f=@(x) x^2+sin(x)+1/x;
%% part 1
disp('f(0)');
disp(f(0));
disp('f(1)');
disp(f(1));
disp('f(2)');
disp(f(2));
%% part 2
x1=[0,1,pi/2,pi];
disp('Vectorised f(x)');
disp(arrayfun(f,x1));
%% part 3
x2=linspace(-1,1);
disp('f(x) with linspace');
disp(arrayfun(f,x2));
%% part 4
l=11;
u=20;
delta=(u-l)/20;
x3=l:delta:u;
disp('f(x) with 20 equally spaced values');
disp(arrayfun(f,x3));
%% part 5
fplot(f,[-pi pi])
f(0)
Inf
f(1)
2.8415
f(2)
5.4093
Vectorised f(x)
Inf 2.8415 4.1040 10.1879
f(x) with linspace
Columns 1 through 12
-0.8415 -0.8910 -0.9402 -0.9893 -1.0381 -1.0869 -1.1356 -1.1845 -1.2334 -1.2827 -1.3323 -1.3825
Columns 13 through 24
-1.4332 -1.4848 -1.5373 -1.5909 -1.6459 -1.7024 -1.7607 -1.8212 -1.8841 -1.9498 -2.0188 -2.0915
Columns 25 through 36
-2.1685 -2.2504 -2.3381 -2.4324 -2.5345 -2.6455 -2.7671 -2.9011 -3.0498 -3.2161 -3.4035 -3.6167
Columns 37 through 48
-3.8616 -4.1461 -4.4806 -4.8798 -5.3644 -5.9649 -6.7280 -7.7291 -9.0985 -11.0825 -14.2085 -19.8479
Columns 49 through 60
-33.0294 -99.0100 99.0102 33.0312 19.8530 14.2185 11.0990 9.1232 7.7636 6.7739 6.0239 5.4381
Columns 61 through 72
4.9698 4.5886 4.2736 4.0104 3.7884 3.5996 3.4383 3.2998 3.1805 3.0775 2.9886 2.9118
Columns 73 through 84
2.8457 2.7889 2.7404 2.6992 2.6647 2.6361 2.6128 2.5944 2.5805 2.5707 2.5646 2.5619
Columns 85 through 96
2.5624 2.5660 2.5722 2.5811 2.5924 2.6059 2.6215 2.6392 2.6588 2.6802 2.7032 2.7279
Columns 97 through 100
2.7542 2.7819 2.8110 2.8415
f(x) with 20 equally spaced values
Columns 1 through 11
120.0909 130.2913 141.0759 152.3888 164.1496 176.2696 188.6689 201.2931 214.1233 227.1805 240.5210
Columns 12 through 21
254.2255 268.3829 283.0724 298.3480 314.2278 330.6901
347.6779 365.1102 382.8982 400.9629
f(x)=x^2+sin(x)+1/x Find f(0), f(1) and f(π/2) Vectorize f and evaluate f(x) where x=[0 1 π/2 π]....
Find all values on the graph of f(x) = x + 2 sin x for 0 < 3 < 2 where the tangent line has slope 0.
Let F(x, y, z) = x2y3 + y 2 sin(π z) /π + z2ex-1 a) Find the equation of the tangent plane to the graph of the function z = z(x, y) at the point (x, y) = (1, 1), if z satisfies the equation F(x, y, z) = 2 with z(1, 1) = 1. b) At the point P(1, 1, 1), determine in which of the two directions ~u = h−4, 3, 0i or ~v = h−3, 0, 4i...
1. (2 points) Find F dF if curl(F) 3 in the region defined by the 4 curves and C4 Ci F . d7 where F(x,y,z)-Wi +pz? + Vi> and C consists of the arc of the 2. (2 points) Evaluate curve y = sin(x) from (0,0) to (π, 0) and the line segment from (π,0) to (0,0). 4 3 3. (2 points) Evaluate F di where F.y,(ry, 2:,3) and C is the curve of intersection of 5 and y29. going...
Determine f(x). f′′(x)=−cos(x)+sin(x), and f(0)=1, f(π)=0. Problem. f"(t) = -cos(T) + sin(), and f(0) = 1, f(1) = 0
It is solved with the following function: f(x) = A sin(n*π*x/L) Maximum If the function is defined between zero and L, find where it is at a maximum. In terms of probability, what is this telling you physically? Probability For n = 4, write down (but do not solve) the integral you would need to evaluate to see if the object is between 0 and L/3. Please include a sketch.
Use left and right endpoints and the given number of rectangles to find two approximations of the area of the region between the graph of the function and the x-axis over the given interval. (Round your answers to four decimal places.) f(x) = cos(x), [0, π/2], 4 rectangles
(1 point) Let Vf =-8xe-r sin(5y) 20e-x. cos(Sy) j. Find the change inf between (0,0) and (1, π/2) in two ways vf . dr, where C is a curve connecting (0,0) and (1.d2). (a) First, find the change by computing the line integral The simplest curve is the line segment joining these points. Parameterize it: with 03t s 1, r(t)- so that Icvf . di- Note that this isn't a very pleasant integral to evaluate by hand (though we could...
Find the Fourier series of f on the given interval. f(x) = 0, −π < x < 0 x2, 0 ≤ x < π Find the Fourier series of f on the given interval. So, -< x < 0 <x< N F(x) = COS nx + sin nx n = 1 eBook
Fix A and α > 0 and let h(x ) = Ae-oz for x > 0 and 0 otherwise (a) Compute h(k). (b) Let f(x)-(sin5x +sin 3x+sin x +sin 40) for 0 π and 0 otherwise. Comipute f(k). x (c) Plot h * f(x) for 0 Discuss. x π and find interesting values of A ard a Fix A and α > 0 and let h(x ) = Ae-oz for x > 0 and 0 otherwise (a) Compute h(k). (b)...
Let X be Uniformly distributed over the interval [0,π/2][0,π/2]. Find the density function for Y=sinXY=sinX. Evaluate the density function (to 2 d.p.) at the value 0.1. the density function is ?