Find graphically the value of x satisifies this equation

  • Thread starter jwxie
  • Start date
  • Tags
    Value
In summary, the code provided uses the definition of the derivative to calculate the slope of the function at each point on the x-axis. It then compares this slope to the value of the expression on the right-hand side of the equation and plots the points where the function crosses the x-axis, as these are the points where the expression on the left-hand side of the equation is equal to zero. The variables h and h1 represent the distance between points on the x-axis, with h1 being a smaller distance used to avoid inaccuracies in the calculations.
  • #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]
Nonetheless, here is my question:

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,
der(n) = (f93(xk)-f93(xk1))/2/h1;
Why are we dividing by 2/h1 ? Isn't the denominator of the definition of limit x-x0?

Thank you very much.
 
Physics news on Phys.org
  • #2

Thank you for your question. I am a scientist and I will try my best to help you understand the code and the mathematics behind it.

Firstly, let's discuss the meaning of the variables h and h1. The variable h represents the size of the interval [a,b] divided by the number of points we want to use to plot (N). This means that h is the distance between two adjacent points on the x-axis. Now, h1 is simply one-tenth of h. This means that h1 is a smaller distance compared to h, which will be useful in our calculations later on.

Now, let's move on to the loop. The loop starts with n=1 and goes up to n=N. This means that we will have N number of points on the x-axis. The x(n) command calculates the points on the x-axis and stores them in a vector called x. Now, xk and xk1 are simply the points to the left and right of the point x(n). The expression (f93(xk)-f93(xk1))/2/h1 is the definition of the derivative. In the definition of the derivative, we have (x-x0) in the denominator. In this case, x0 is represented by h1, which is a very small number. Dividing by a small number can lead to inaccuracies in our calculations, so we multiply by 2/h1 to avoid this problem.

Overall, the code is using the definition of the derivative to calculate the slope of the function at each point on the x-axis. We then compare this slope to the value of the expression on the right-hand side of the equation. If the difference between the two is very small (close to zero), then the point x(n) satisfies the equation. This is why the code plots the points where the function crosses the x-axis, because those are the points where the expression on the left-hand side of the equation is equal to zero.

I hope this helps you understand the code and the mathematics behind it. Let me know if you have any further questions.
 

What does it mean to "find graphically the value of x satisfies this equation"?

Graphically finding the value of x that satisfies an equation involves plotting the equation on a graph and locating the point(s) where the graph intersects the x-axis. These points represent the value(s) of x that make the equation true.

Why is it useful to find the value of x graphically?

Graphically finding the value of x can provide a visual representation of the solution to an equation, making it easier to understand and verify. It can also be helpful in identifying multiple solutions or estimating approximate solutions.

What information is needed to graphically find the value of x?

In order to graphically find the value of x, you will need to know the equation, the range of x values to be considered, and any restrictions or conditions on the equation.

How do I graphically find the value of x?

To graphically find the value of x, you will need to plot the equation on a graph and identify the point(s) where the graph intersects the x-axis. You can then read the corresponding x-value(s) from the graph.

What are some common mistakes when graphically finding the value of x?

Some common mistakes when graphically finding the value of x include not properly identifying the x-intercepts on the graph, not considering all possible solutions, and not taking into account any restrictions or conditions on the equation.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
566
  • Calculus and Beyond Homework Help
Replies
3
Views
1K
  • Calculus and Beyond Homework Help
Replies
7
Views
2K
Replies
1
Views
619
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
32
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
972
  • Advanced Physics Homework Help
Replies
24
Views
799
  • Thermodynamics
Replies
3
Views
1K
  • Programming and Computer Science
Replies
7
Views
3K
Back
Top