You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何求函数$2\sin\left(x\right)-\cos\left(2x\right)$的全局最大值

Finding the Global Maximum of $2\sin(x)-\cos(2x)$

Hey there! Glad you’ve already nailed the local maxima and minima—let’s build on that to find the global maximum. Here’s a straightforward approach:

Step 1: Rewrite the function using trigonometric identities

First, use the double-angle identity for cosine: $\cos(2x) = 1 - 2\sin^2(x)$. Substitute this into your function:
$$
2\sin(x) - \cos(2x) = 2\sin(x) - (1 - 2\sin^2(x)) = 2\sin^2(x) + 2\sin(x) - 1
$$

Step 2: Convert to a quadratic function via substitution

Let $t = \sin(x)$. Since $\sin(x)$ always ranges between $-1$ and $1$, we have $t \in [-1, 1]$. Now your function becomes a quadratic in $t$:
$$
f(t) = 2t^2 + 2t - 1
$$

Step 3: Analyze the quadratic function on the closed interval $[-1, 1]$

This quadratic opens upwards (the coefficient of $t^2$ is positive), so its vertex is a minimum point. The vertex occurs at $t = -\frac{b}{2a} = -\frac{2}{2 \times 2} = -\frac{1}{2}$.

For upward-opening quadratics on a closed interval, the maximum value will always be at one of the endpoints. Let’s calculate $f(t)$ at $t=1$ and $t=-1$:

  • When $t=1$: $f(1) = 2(1)^2 + 2(1) - 1 = 2 + 2 - 1 = 3$
  • When $t=-1$: $f(-1) = 2(-1)^2 + 2(-1) - 1 = 2 - 2 - 1 = -1$

Step 4: Map back to the original trigonometric function

Since $t = \sin(x) = 1$, this occurs when $x = \frac{\pi}{2} + 2k\pi$ (where $k$ is any integer). The corresponding function value is $3$, which is the global maximum.

Why this works

Because $2\sin(x)-\cos(2x)$ is a periodic function (period $2\pi$), its global maximum must be equal to the largest local maximum across one full period. By converting it to a quadratic on a bounded interval, we can easily confirm that $3$ is indeed the highest possible value the function can take.

内容的提问来源于stack exchange,提问作者Jakob

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 03:21:46