x <- seq(-1,5,0.1)
y <- -x^2 + 4*x
plot(x,y, type="l")
points(2,4, col="red", pch=19)Hľadanie maxima funkcie
1 Úvod
Cieľom práce je nájsť maximum funkcie pomocou derivácie.
2 Teória
Derivácie sa používajú na hľadanie extrémov funkcií (Stewart, 2015).
Máme funkciu:
\[ f(x) = -x^2 + 4x \]
3 Výpočet
Najprv nájdeme deriváciu:
\[ f'(x) = -2x + 4 \]
Teraz nájdeme, kde je derivácia rovná nule:
\[ -2x + 4 = 0 \]
Z toho:
\[ x = 2 \]
4 Graf
5 Záver
5.1 Maximum funkcie je v bode x = 2.
5.2 Quarto
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see https://quarto.org.
5.3 Running Code
When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:
You can add options to executable code like this
The echo: false option disables the printing of code (only output is displayed).