Determine the intervals on which the function f(x) is increasing and decreasing
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi there
I am struggeling to compute this
I need to get the intervals where f(x) is increasing rounded to 4 decimal values as output
I realise it will be where f'(x)>0 and f'(x)<0
this is what i got sofar:
clf
f = sinh(x.^2);
h = sqrt(cosh(x)-1);
fplot(diff(f)-diff(h))
grid on
ylim([-5 5])
xlim([-5 5])
댓글 수: 0
채택된 답변
Walter Roberson
2020년 12월 6일
syms x
f = sinh(x.^2);
g = diff(f);
sol = solve(g == 0, 'returnconditions', true)
sol.x
sol.conditions
by inspection: (-1)^(1/4) is complex-valued. sqrt(k+1/2) is complex valued for integer k <= -1, and complex times the complex root of unity is potentially real-valued. For integer k = 0 and upwards, sqrt(k+1/2) is real valued, and real times the complex root of unity is always complex-valued.
Therefore, we only need to consider k = -1 and less
assume(sol.parameters, 'integer')
curl = simplify(subs(diff(g), x, sol.x))
The signs of those are the important parts: positive for local minima, negative for local maxima. For negative k, 2*k+1 is always negative, and -2*pi is always negative, so the sign comes down to the sign of (-1)^k which is negative for odd k (local maxima) and positive for even k (local minima)
sol.x tells you where the critical points are; curl tells you the maxima / minima. If you are at a local maxima, then everything to the next local minima (greater x, so decreasing k) is decreasing; if you are at a local minima, then everything until the next local maxima (greater x, so decreasing k) is increasing.
추가 답변 (1개)
tarun Kumar v
2021년 11월 26일
clf
f = sinh(x.^2);
h = sqrt(cosh(x)-1);
fplot(diff(f)-diff(h))
grid on
ylim([-5 5])
xlim([-5 5])
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


