- #1
jwxie
- 281
- 0
Homework Statement
Find graphically the value of x in the interval [0,2] which satisfies the equation[itex]\frac{\mathrm{d} }{\mathrm{d} x} \left ( \frac{e^{-x^2}sin(x^{2})}{cos(x)+3} \right )=\frac{x^{2}}{10+x}[/itex]
Homework Equations
Definition of limits f ' (x0) = lim x -> x0 f(x)-f(x0)/(x-x0)
The Attempt at a Solution
First of all, thank you for all the helps thus far.
I have MATLAB code available from my professor. This is Matlab related, but my problem touches on the mathematics procedures, so I am asking the question here.
Here is the code. I wrote the comment, so if there's any mistakes please point it out.
Code:
% Interval of interest [a,b]
a = 0; b = 2;
N = 500; % number of points to use to plot (the larger the better)
h = (b-a)/N; %
h1 = h/10;
for n = 1:N
x(n)=a+n*h; % construct points of limit squence
xk = x(n)+h1; % calculate all the points to the left of x(n)
xk1 = x(n)-h1; % calculate all the points to the right of x(n)
der(n) = (f93(xk)-f93(xk1))/2/h1; % the derivative
r(n) = x(n)^2/(10+x(n)); % gives the vector of the expression on the right hand side
y(n)=0; % satisfies the equation, y(n) must equal to zero for some n
end
% the minus gives lefthand expression - righthand expression = 0
plot(x,der-r, '--g',x,y)
% The points which satisify the equation are the x-intercepts.
% Thus, the x points that crosses the x-axis are the solutiona
% x = 0, x = 0.8 in the interval [0,2]
Right below N = 500, he wrote
h = (b-a)/N; %
h1 = h/10;
What is he doing? As I go down the code, it seems h1 is x0. But how did he come up with this idea that x0 would be h/10 ?This also leads to the question,
Why are we dividing by 2/h1 ? Isn't the denominator of the definition of limit x-x0?der(n) = (f93(xk)-f93(xk1))/2/h1;
Thank you very much.