How to linearize a function?
45 views (last 30 days)
Show older comments
hi
I want to linearize following function:
f(2) = ((12.85)*(x.^(-1)))+((17.72)*(x.^0.5));
Answers (2)
John D'Errico
on 23 Dec 2018
Edited: John D'Errico
on 23 Dec 2018
It is not linear. So anything you do can only succeed as an approximation. Worse, since a singularity exists at x==0, a simple brute force linearization must fail, at least one that would be valid for all x.
However, nothing stops you from finding an expansion around some general value of x that is non-zero. Thus, a simple linearization is essentially a truncated Taylor series, but expanded around some other origin. Suppose you wanted to linearize that function around some general x0, where x0 is NOT equal to 0.
syms x x0
F = ((12.85)*(x.^(-1)))+((17.72)*(x.^0.5));
Flin = subs(F,x0) + (x-x0)*subs(diff(F,x),x0)
Flin =
257/(20*x0) + (443*x0^(1/2))/25 - (x - x0)*(257/(20*x0^2) - 443/(50*x0^(1/2)))
So around say x0==2, what happens?
ezplot(F,[0,10])
hold on
ezplot(subs(Flin,x0,2),[1 3])
legend('F(x)','Flin(x)')

The blue curve is F(x). The green line is the linearized approximation, Flin. Again, it will fail at x0==0.
Now, could I have gotten that same approximation using one call in MATLAB? Well, yes, as longas I know how to use the taylor utility in the symbolic toolbox.
taylor(F,x,'ExpansionPoint',x0,'order',2)
ans =
257/(20*x0) + (443*x0^(1/2))/25 - (x - x0)*(257/(20*x0^2) - 443/(50*x0^(1/2)))
As you see, we got the same result.
0 Comments
Star Strider
on 23 Dec 2018
Calculate the partial derivative of your function with respect to each variable, then add the value of the original function near the region of interest. See the Wikipedia article on Linearization (specifically Linearization of a Multivariable Function (link)) for details.
Here,
syms f(x)
f = ((12.85)*(x.^(-1)))+((17.72)*(x.^0.5));
f_lin = diff(f,x)
producing:
f_lin =
443/(50*x^(1/2)) - 257/(20*x^2)

0 Comments
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!