Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
% (find-LATEX "2024-2-C3-P1.tex")
% (defun c () (interactive) (find-LATEXsh "lualatex -record 2024-2-C3-P1.tex" :end))
% (defun C () (interactive) (find-LATEXsh "lualatex 2024-2-C3-P1.tex" "Success!!!"))
% (defun D () (interactive) (find-pdf-page      "~/LATEX/2024-2-C3-P1.pdf"))
% (defun d () (interactive) (find-pdftools-page "~/LATEX/2024-2-C3-P1.pdf"))
% (defun e () (interactive) (find-LATEX "2024-2-C3-P1.tex"))
% (defun o () (interactive) (find-LATEX "2024-1-C3-P1.tex"))
% (defun u () (interactive) (find-latex-upload-links "2024-2-C3-P1"))
% (defun v () (interactive) (find-2a '(e) '(d)))
% (defun d0 () (interactive) (find-ebuffer "2024-2-C3-P1.pdf"))
% (defun cv () (interactive) (C) (ee-kill-this-buffer) (v) (g))
% (defun oe () (interactive) (find-2a '(o) '(e)))
%          (code-eec-LATEX "2024-2-C3-P1")
% (find-pdf-page   "~/LATEX/2024-2-C3-P1.pdf")
% (find-sh0 "cp -v  ~/LATEX/2024-2-C3-P1.pdf /tmp/")
% (find-sh0 "cp -v  ~/LATEX/2024-2-C3-P1.pdf /tmp/pen/")
%     (find-xournalpp "/tmp/2024-2-C3-P1.pdf")
%   file:///home/edrx/LATEX/2024-2-C3-P1.pdf
%               file:///tmp/2024-2-C3-P1.pdf
%           file:///tmp/pen/2024-2-C3-P1.pdf
%  http://anggtwu.net/LATEX/2024-2-C3-P1.pdf
% (find-LATEX "2019.mk")
% (find-Deps1-links "Caepro5 Piecewise2 Maxima2")
% (find-Deps1-cps   "Caepro5 Piecewise2 Maxima2")
% (find-Deps1-anggs "Caepro5 Piecewise2 Maxima2")
% (find-MM-aula-links "2024-2-C3-P1" "3" "c3m242p1" "c3p1")

% «.defs»		(to "defs")
% «.defs-T-and-B»	(to "defs-T-and-B")
% «.defs-caepro»	(to "defs-caepro")
% «.defs-pict2e»	(to "defs-pict2e")
% «.defs-maxima»	(to "defs-maxima")
% «.defs-V»		(to "defs-V")
% «.title»		(to "title")
% «.links»		(to "links")
% «.questao-1»		(to "questao-1")
% «.algumas-defs»	(to "algumas-defs")
% «.questao-2»		(to "questao-2")
% «.barranco-defs»	(to "barranco-defs")
% «.questao-1-grids»	(to "questao-1-grids")
% «.gab-1»		(to "gab-1")
% «.gab-1-maxima»	(to "gab-1-maxima")
% «.gab-1-p2»		(to "gab-1-p2")
% «.gab-1-p3»		(to "gab-1-p3")
% «.gab-1-p4»		(to "gab-1-p4")
% «.gab-1-p5»		(to "gab-1-p5")



\documentclass[oneside,12pt]{article}
\usepackage[colorlinks,citecolor=DarkRed,urlcolor=DarkRed]{hyperref} % (find-es "tex" "hyperref")
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{pict2e}
\usepackage[x11names,svgnames]{xcolor} % (find-es "tex" "xcolor")
\usepackage{colorweb}                  % (find-es "tex" "colorweb")
%\usepackage{tikz}
%
% (find-LATEX "dednat7-test1.tex")
%\usepackage{proof}   % For derivation trees ("%:" lines)
%\input diagxy        % For 2D diagrams ("%D" lines)
%\xyoption{curve}     % For the ".curve=" feature in 2D diagrams
%
\usepackage{edrx21}               % (find-LATEX "edrx21.sty")
\input edrxaccents.tex            % (find-LATEX "edrxaccents.tex")
\input edrx21chars.tex            % (find-LATEX "edrx21chars.tex")
\input edrxheadfoot.tex           % (find-LATEX "edrxheadfoot.tex")
\input edrxgac2.tex               % (find-LATEX "edrxgac2.tex")
%
% (find-es "tex" "geometry")
\usepackage[a6paper, landscape,
            top=1.5cm, bottom=.25cm, left=1cm, right=1cm, includefoot
           ]{geometry}
%
\begin{document}

% «defs»  (to ".defs")
% (find-LATEX "edrx21defs.tex" "colors")
% (find-LATEX "edrx21.sty")

\def\drafturl{http://anggtwu.net/LATEX/2024-2-C3.pdf}
\def\drafturl{http://anggtwu.net/2024.2-C3.html}
\def\draftfooter{\tiny \href{\drafturl}{\jobname{}} \ColorBrown{\shorttoday{} \hours}}

% (find-LATEX "2024-1-C2-carro.tex" "defs-caepro")
% (find-LATEX "2024-1-C2-carro.tex" "defs-pict2e")

\catcode`\^^J=10
\directlua{dofile "dednat7load.lua"}  % (find-LATEX "dednat7load.lua")
\directlua{dednat7preamble()}         % (find-angg "LUA/DednatPreamble1.lua")
\directlua{dednat7oldheads()}         % (find-angg "LUA/Dednat7oldheads.lua")

% «defs-T-and-B»  (to ".defs-T-and-B")
\long\def\ColorDarkOrange#1{{\color{orange!90!black}#1}}
\def\T(Total: #1 pts){{\bf(Total: #1)}}
\def\T(Total: #1 pts){{\bf(Total: #1 pts)}}
\def\T(Total: #1 pts){\ColorRed{\bf(Total: #1 pts)}}
\def\B       (#1 pts){\ColorDarkOrange{\bf(#1 pts)}}

% «defs-caepro»  (to ".defs-caepro")
%L dofile "Caepro5.lua"              -- (find-angg "LUA/Caepro5.lua" "LaTeX")
\def\Caurl   #1{\expr{Caurl("#1")}}
\def\Cahref#1#2{\href{\Caurl{#1}}{#2}}
\def\Ca      #1{\Cahref{#1}{#1}}

% «defs-pict2e»  (to ".defs-pict2e")
%L dofile "Piecewise2.lua"           -- (find-LATEX "Piecewise2.lua")
%L --dofile "Escadas1.lua"           -- (find-LATEX "Escadas1.lua")
\def\pictgridstyle{\color{GrayPale}\linethickness{0.3pt}}
\def\pictaxesstyle{\linethickness{0.5pt}}
\def\pictnaxesstyle{\color{GrayPale}\linethickness{0.5pt}}
\celllower=2.5pt

% «defs-maxima»  (to ".defs-maxima")
%L dofile "Maxima2.lua"              -- (find-angg "LUA/Maxima2.lua")
\pu

% «defs-V»  (to ".defs-V")
%L --- See: (find-angg "LUA/MiniV1.lua" "problem-with-V")
%L V = MiniV
%L v = V.fromab
\pu


%  _____ _ _   _                               
% |_   _(_) |_| | ___   _ __   __ _  __ _  ___ 
%   | | | | __| |/ _ \ | '_ \ / _` |/ _` |/ _ \
%   | | | | |_| |  __/ | |_) | (_| | (_| |  __/
%   |_| |_|\__|_|\___| | .__/ \__,_|\__, |\___|
%                      |_|          |___/      
%
% «title»  (to ".title")
% (c3m242p1p 1 "title")
% (c3m242p1a   "title")

\thispagestyle{empty}

\begin{center}

\vspace*{1.2cm}

{\bf \Large Cálculo 3 - 2024.2}

\bsk

P1 (primeira prova)

\bsk

Eduardo Ochs - RCN/PURO/UFF

\url{http://anggtwu.net/2024.2-C3.html}

\end{center}

\newpage

% «links»  (to ".links")
% (c3m242p1p 2 "links")
% (c3m242p1a   "links")

{\bf Links}

\scalebox{0.6}{\def\colwidth{16cm}\firstcol{

\par \url{http://anggtwu.net/e/maxima.e.html\#2024.2-C3-P1-Q1}
\par \url{http://anggtwu.net/e/maxima.e.html\#2024.2-C3-P1-Q2}
\par \texttt{(find-es "maxima" "2024.2-C3-P1-Q1")}
\par \texttt{(find-es "maxima" "2024.2-C3-P1-Q2")}



}\anothercol{
}}

\newpage

% «questao-1»  (to ".questao-1")
% (c3m242p1p 3 "questao-1")
% (c3m242p1a   "questao-1")
% (c3m241p1p 3 "questao-1")
% (c3m241p1a   "questao-1")

{\bf Questão 1}

\scalebox{0.58}{\def\colwidth{9cm}\firstcol{

\vspace*{-0.5cm}

\T(Total: 3.5 pts)

O diagrama de numerozinhos da última folha da prova corresponde a uma
superfície $z=F(x,y)$ que tem 6 faces. Também é possível interpretá-lo
como uma superfície com 7 ou mais faces, mas vamos considerar que a
superfície com só 6 faces é que é a correta.

\msk

a) \B (0.5 pts) Mostre como dividir o plano em 6 polígonos que são as
projeções destas faces no plano do papel.

\msk

b) \B (0.5 pts) Chame estas faces de face N (``norte''), S (``sul''),
W (``oeste''), C (``centro''), E (``leste'') e NE
(``nordeste''), e chame as equações dos planos delas de
$F_{N}(x,y)$, $F_{S}(x,y)$, $F_{W}(x,y)$, $F_{C}(x,y)$, $F_{E}(x,y)$,
e $F_{NE}(x,y)$. Dê as equações destes planos.

\msk

c) \B (0.5 pts) Sejam:
%
$$\begin{array}{rcl}
  P_{C} &=& \setofxyzst{z = F_{C}(x,y)}, \\
  P_{E} &=& \setofxyzst{z = F_{E}(x,y)}, \\
  r &=& P_{C} ∩ P_{E}. \\
  \end{array}
$$

Represente a reta $r$ graficamente como numerozinhos.

}\anothercol{

  d) \B (0.5 pts) Dê uma parametrização para a reta do item anterior.
  Use notação de conjuntos.

  \msk

  e) \B (0.5 pts) Seja
  %
  $$A \;=\; \{0,1,\ldots,9\} × \{0,1,\ldots,11\};$$

  note que os numerozinhos do diagrama de numerozinhos estão todos
  sobre pontos de $A$. Para cada ponto $(x,y)∈A$ represente
  graficamente $(x,y)+\frac13 \vec∇F(x,y)$.

  \ssk

  Obs: quando $\vec∇F(x,y)=0$ desenhe uma bolinha preta sobre o ponto
  $(x,y)$, e quando $\vec∇F(x,y)$ não existir faça um `$×$' sobre o
  numerozinho que está no ponto $(x,y)$.

  \msk

  f) \B (1.0 pts) Sejam
  %
  $$\begin{array}{rcl}
    Q(t) &=& (0,2) + t\VEC{1,1}, \\
    (x(t),y(t)) &=& Q(t), \\
    h(t) &=& F(x(t),y(t)). \\
    \end{array}
  $$

  Faça o gráfico da função $h(t)$. Considere que o domínio dela é o
  intervalo $[0,9]$.

}}


\newpage

% «algumas-defs»  (to ".algumas-defs")
% (c3m242p1p 4 "algumas-defs")
% (c3m242p1a   "algumas-defs")

\sa{Tf}{T_{2,x_0}f}
\sa{TF}{T_{2,(x_0,y_0)}F}

{\bf Algumas definições}

\scalebox{0.6}{\def\colwidth{16cm}\firstcol{

Em Cálculo 1 e Cálculo 2 você viu que se $f(x)$ é uma função de $\R$
em $\R$ então a aproximação de Taylor de ordem 2 pra $f(x)$ no ponto
$x_0$ é:
%
$$\begin{array}{ccl}
  (\ga{Tf})(x) &=& f(x_0) \\
               &+& f'(x_0)Δx \\
               &+& \frac{f''(x_0)}{2}Δx^2 \\
  \end{array}
$$

A ``versão Cálculo 3'' disto é a fórmula abaixo. Se $F(x,y)$ é uma
função de $\R^2$ em $\R$ então a aproximação de Taylor de ordem 2 pra
$F(x,y)$ no ponto $(x_0,y_0)$ é:
%
$$\begin{array}{ccl}
  (\ga{TF})(x) &=& F(x_0,y_0) \\
               &+& F_x(x_0,y_0)Δx + F_y(x_0,y_0)Δy \\
               &+& \frac{F_{xx}(x_0,y_0)}{2}Δx^2
                 + F_{xy}(x_0,y_0)ΔxΔy
                 + \frac{F_{yy}(x_0,y_0)}{2}Δy^2 \\
  \end{array}
$$

e a gente diz que as derivadas até ordem 2 da função $F$ são as
funções $(F,F_x,F_y,F_{xx},F_{xy},F_{yy})$. Eu costumo organizar elas
numa matriz:
%
$$D_2F = \pmat{F \\ F_x & F_y \\ F_{xx} & F_{xy} & F_{yy}}$$

$$(D_2F)(x_0,y_0) = \pmat{F(x_0,y_0) \\
                          F_x(x_0,y_0) & F_y(x_0,y_0) \\
                          F_{xx}(x_0,y_0) & F_{xy}(x_0,y_0) & F_{yy}(x_0,y_0) \\
                         }
$$

}}


\newpage

% «questao-2»  (to ".questao-2")
% (c3m242p1p 5 "questao-2")
% (c3m242p1a   "questao-2")
% (find-es "maxima" "2024.2-C3-P1")

{\bf Questão 2}

\sa{Tf}{T_{2,x_0}f}
\sa{TF}{T_{2,(x_0,y_0)}F}
\sa{TFP2}{T_{2,(1,2)}F}




% «questao-3»  (to ".questao-3")
% (c3m241p1p 4 "questao-3")
% (c3m241p1a   "questao-3")
% (find-es "maxima" "2024-1-C3-P1-Q3")


\scalebox{0.6}{\def\colwidth{9cm}\firstcol{

\vspace*{0cm}

\T(Total: 6.5 pts)

Sejam
%
$$\begin{array}{rcl}
  F(x,y) &=& xy(6-2x-y), \\
     P_1 &=& (0,6), \\
     P_2 &=& (1,2), \\
     P_3 &=& (3,0), \\
     P_4 &=& (0,0). \\
  \end{array}
$$

a) \B (0.5 pts) Calcule $D_2F$.

\ssk

b) \B (0.5 pts) Calcule $D_2F$ nos pontos $P_1$, $P_2$, $P_3$, e
$P_4$.

\ssk

c) \B (1.0 pts) Calcule $\ga{TF}$ nos pontos $P_1$, $P_2$, $P_3$, e
$P_4$.

\ssk


d) \B (0.5 pts) Os pontos $P_1, P_2, P_3$ e $P_4$ são pontos críticos
da função $F$? Quais deles são máximos locais? Quais são mínimos
locais? Quais são pontos de sela? Use o gradiente e o determinante
$\left| \sm{F_{xx} & F_{xy} \\ F_{yx} & F_{yy}} \right|$ pra
descobrir tudo isso.


}\anothercol{

\vspace*{0cm}

Lembre que $P_2 = (1,2)$.

Seja $G(x,y) = (\ga{TFP2})(x,y)$.

Seja $B = \{0,...,3\}×\{0,...,6\}$

e $C = \setofst{(x,y)∈B}{y≤6-2x}$.



\bsk

e) \B (0.5 pts) Calcule o diagrama de numerozinhos da função $F$ nos
pontos de $C$.

\ssk

f) \B (1.0 pts) Calcule o diagrama de numerozinhos da função $G$ nos
pontos de $C$.

\bsk

g) \B (2.5 pts) Use o diagrama de numerozinhos da $F$ que você
calculou no item (e) e os gradientes da $F$ nos pontos de $C$ -- que
você ainda não calculou, e vai ter que calcular agora -- pra fazer um
desenho bem caprichado das curvas de nível da $F$ dentro do triângulo
cujos vértices são os pontos $P_1, P_3$ e $P_4$. Você vai precisar
reduzir a escala dos vetores gradientes pra que eles não esbarrem uns
nos outros -- desenhe $F(x,y) + \frac{1}{10}∇F(x,y)$ para cada ponto
de $C$.


}}




\newpage


% «barranco-defs»  (to ".barranco-defs")  
% (c3m242p1p 99 "barranco-defs")
% (c3m242p1a    "barranco-defs")
% (find-angg "GNUPLOT/2024-2-C3-P1.dem")
% (find-angg "GNUPLOT/2024-2-C3-P1.dem")
% (find-bgprocess "gnuplot ~/GNUPLOT/2024-2-C3-P1.dem")

% (find-eepitch-intro "3.3. `eepitch-preprocess-line'")
% (setq eepitch-preprocess-regexp "")
% (setq eepitch-preprocess-regexp "^%?%L ?")
%
%%L * (eepitch-lua51)
%%L * (eepitch-kill)
%%L * (eepitch-lua51)
%%L Path.prependtopath "~/LUA/?.lua"
%L require "Cabos3"
%L require "Numerozinhos1"
%L PictBounds.setbounds(v(0,0), v(9,11))
%L
%L bigstr1 = [[
%L   6 6 6 6 6 6 6 6 6 6
%L   6 6 6 6 6 6 6 6 6 6
%L   6 6 6 6 6 5 5 5 5 5
%L   6 6 6 6 5 4 4 4 4 4
%L   6 6 6 5 4 3 2 2 2 2 
%L   5 5 5 4 3 2 1 0 0 0
%L   4 4 4 3 2 1 0 0 0 0
%L   3 3 3 2 1 0 0 0 0 0
%L   2 2 2 1 0 0 0 0 0 0
%L   1 1 1 0 0 0 0 0 0 0
%L   0 0 0 0 0 0 0 0 0 0
%L   0 0 0 0 0 0 0 0 0 0
%L ]]
%L bigstr2 = [[
%L   6 - 6 - 6 - 6 - 6 - 6 - 6 - 6 - 6 - 6
%L   | . | . | . | . | . | . | . | . | . |
%L   6 - 6 - 6 - 6 - 6 - C - 6 - 6 - 6 - D
%L   | . | . | . | . | / | . | . | . | . |
%L   6 - 6 - 6 - 6 - 6 - 5 - 5 - 5 - 5 - 5
%L   | . | . | . | / | . | . | . | . | . |
%L   6 - 6 - 6 - 6 - 5 - E - 4 - 4 - 4 - F
%L   | . | . | / | . | . | \ | . | . | . |
%L   A - 6 - B - 5 - 4 - 3 - 2 - 2 - 2 - 2
%L   | . | . | . | . | . | . | \ | . | . |
%L   5 - 5 - 5 - 4 - 3 - 2 - 1 - I - 0 - J
%L   | . | . | . | . | . | . | / | . | . |
%L   4 - 4 - 4 - 3 - 2 - 1 - 0 - 0 - 0 - 0
%L   | . | . | . | . | . | / | . | . | . |
%L   3 - 3 - 3 - 2 - 1 - 0 - 0 - 0 - 0 - 0
%L   | . | . | . | . | / | . | . | . | . |
%L   2 - 2 - 2 - 1 - 0 - 0 - 0 - 0 - 0 - 0
%L   | . | . | . | / | . | . | . | . | . |
%L   1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0
%L   | . | . | / | . | . | . | . | . | . |
%L   G - 0 - H - 0 - 0 - 0 - 0 - 0 - 0 - 0
%L   | . | . | . | . | . | . | . | . | . |
%L   0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0
%L ]]
%L clabels = CabosNaDiagonal.from(bigstr2)
%L lbls    = clabels.strgrid:labels()
%L spec    = lbls:subst("A--B--C--D C--E--I E--F B--H G--H--I--J")
%L ns = Numerozinhos.from(0, 0, bigstr1)
%L p1 = ns:show0 {u="25pt"}:sa("barranco")
%L ns:setspec(spec)
%L p2 = ns:show0():sa("barranco 2")
%L p3 = Pict { p1, p2 }
%L p4 = Pict { p1, p2, [[\ga{barranco} \ga{barranco com linhas}]] }
%L p3:output()
%L -- p4:output()
%%L = p4:show("")
%%L = Show.bigstr
%%L * (etv)
\pu

% «questao-1-grids»  (to ".questao-1-grids")
% (c3m242p1p 4 "questao-1-grids")
% (c3m242p1a   "questao-1-grids")
% (c3m241p1p 5 "questao-1-grids")
% (c3m241p1a   "questao-1-grids")

\def\barra{\scalebox{0.35}{\ga{barranco}}}
\def\barras{\barra \quad \barra \quad \barra}

$\begin{array}{l}
 \barras \\ \\[-5pt]
 \barras \\
 \end{array}
$


\newpage



% «gab-1»  (to ".gab-1")
% (c3m242p1p 5 "gab-1")
% (c3m242p1a   "gab-1")

{\bf Questão 1: gabarito}

\bsk

$\scalebox{0.9}{\ga{barranco 2}}$

\newpage

% «gab-1-maxima»  (to ".gab-1-maxima")
% (c3m242p1p 6 "gab-1-maxima")
% (c3m242p1a   "gab-1-maxima")
% (find-es "maxima" "2024.2-C3-P1-Q1-latex")

%M (%i1) mkmatrix5(x,xs,y,ys,expr) ::=
%M   buildq([x,xs,y,ys,expr],
%M          apply('matrix,
%M                makelist(makelist(expr,x,xs),y,ys)))$
%M (%i2) /* (1a) */
%M /* (1b) */
%M z_N  : 6$
%M (%i3) z_S  : 0$
%M (%i4) z_W  : y - 1;
%M (%o4) y-1
%M (%i5) z_C  : y - x + 1;
%M (%o5) y-x+1
%M (%i6) z_E  : -12 + 2*y;
%M (%o6) 2\,y-12
%M (%i7) z_NE : -4 + y;
%M (%o7) y-4
%M (%i8) z_MR : min(z_E, z_NE);            /* middle right */
%M (%o8) \mathrm{min}\left(y-4 , 2\,y-12\right)
%M (%i9) z_M  : min(z_W, max(z_C, z_MR));  /* middle */
%M (%o9) \mathrm{min}\left(\mathrm{max}\left(\mathrm{min}\left(y-4 , 2\,y-12\right) , y-x+1\right) , y-1\right)
%M (%i10) z    : min(z_N, max(z_S, z_M))$
%L maximahead:sa("Q1", "")
\pu

%M (%i11) mkmatrix5(x,seq(0,9), y,seqby(11,0,-1), [x,y]);
%M (%o11) \begin{pmatrix}\left[ 0 , 11 \right] &\left[ 1 , 11 \right] &\left[ 2 , 11 \right] &\left[ 3 , 11 \right] &\left[ 4 , 11 \right] &\left[ 5 , 11 \right] &\left[ 6 , 11 \right] &\left[ 7 , 11 \right] &\left[ 8 , 11 \right] &\left[ 9 , 11 \right] \cr \left[ 0 , 10 \right] &\left[ 1 , 10 \right] &\left[ 2 , 10 \right] &\left[ 3 , 10 \right] &\left[ 4 , 10 \right] &\left[ 5 , 10 \right] &\left[ 6 , 10 \right] &\left[ 7 , 10 \right] &\left[ 8 , 10 \right] &\left[ 9 , 10 \right] \cr \left[ 0 , 9 \right] &\left[ 1 , 9 \right] &\left[ 2 , 9 \right] &\left[ 3 , 9 \right] &\left[ 4 , 9 \right] &\left[ 5 , 9 \right] &\left[ 6 , 9 \right] &\left[ 7 , 9 \right] &\left[ 8 , 9 \right] &\left[ 9 , 9 \right] \cr \left[ 0 , 8 \right] &\left[ 1 , 8 \right] &\left[ 2 , 8 \right] &\left[ 3 , 8 \right] &\left[ 4 , 8 \right] &\left[ 5 , 8 \right] &\left[ 6 , 8 \right] &\left[ 7 , 8 \right] &\left[ 8 , 8 \right] &\left[ 9 , 8 \right] \cr \left[ 0 , 7 \right] &\left[ 1 , 7 \right] &\left[ 2 , 7 \right] &\left[ 3 , 7 \right] &\left[ 4 , 7 \right] &\left[ 5 , 7 \right] &\left[ 6 , 7 \right] &\left[ 7 , 7 \right] &\left[ 8 , 7 \right] &\left[ 9 , 7 \right] \cr \left[ 0 , 6 \right] &\left[ 1 , 6 \right] &\left[ 2 , 6 \right] &\left[ 3 , 6 \right] &\left[ 4 , 6 \right] &\left[ 5 , 6 \right] &\left[ 6 , 6 \right] &\left[ 7 , 6 \right] &\left[ 8 , 6 \right] &\left[ 9 , 6 \right] \cr \left[ 0 , 5 \right] &\left[ 1 , 5 \right] &\left[ 2 , 5 \right] &\left[ 3 , 5 \right] &\left[ 4 , 5 \right] &\left[ 5 , 5 \right] &\left[ 6 , 5 \right] &\left[ 7 , 5 \right] &\left[ 8 , 5 \right] &\left[ 9 , 5 \right] \cr \left[ 0 , 4 \right] &\left[ 1 , 4 \right] &\left[ 2 , 4 \right] &\left[ 3 , 4 \right] &\left[ 4 , 4 \right] &\left[ 5 , 4 \right] &\left[ 6 , 4 \right] &\left[ 7 , 4 \right] &\left[ 8 , 4 \right] &\left[ 9 , 4 \right] \cr \left[ 0 , 3 \right] &\left[ 1 , 3 \right] &\left[ 2 , 3 \right] &\left[ 3 , 3 \right] &\left[ 4 , 3 \right] &\left[ 5 , 3 \right] &\left[ 6 , 3 \right] &\left[ 7 , 3 \right] &\left[ 8 , 3 \right] &\left[ 9 , 3 \right] \cr \left[ 0 , 2 \right] &\left[ 1 , 2 \right] &\left[ 2 , 2 \right] &\left[ 3 , 2 \right] &\left[ 4 , 2 \right] &\left[ 5 , 2 \right] &\left[ 6 , 2 \right] &\left[ 7 , 2 \right] &\left[ 8 , 2 \right] &\left[ 9 , 2 \right] \cr \left[ 0 , 1 \right] &\left[ 1 , 1 \right] &\left[ 2 , 1 \right] &\left[ 3 , 1 \right] &\left[ 4 , 1 \right] &\left[ 5 , 1 \right] &\left[ 6 , 1 \right] &\left[ 7 , 1 \right] &\left[ 8 , 1 \right] &\left[ 9 , 1 \right] \cr \left[ 0 , 0 \right] &\left[ 1 , 0 \right] &\left[ 2 , 0 \right] &\left[ 3 , 0 \right] &\left[ 4 , 0 \right] &\left[ 5 , 0 \right] &\left[ 6 , 0 \right] &\left[ 7 , 0 \right] &\left[ 8 , 0 \right] &\left[ 9 , 0 \right] \cr \end{pmatrix}
%M (%i12) mkmatrix5(x,seq(0,8), y,seqby(11,0,-1), ''z);
%M (%o12) \begin{pmatrix}6&6&6&6&6&6&6&6&6\cr 6&6&6&6&6&6&6&6&6\cr 6&6&6&6&6&5&5&5&5\cr 6&6&6&6&5&4&4&4&4\cr 6&6&6&5&4&3&2&2&2\cr 5&5&5&4&3&2&1&0&0\cr 4&4&4&3&2&1&0&0&0\cr 3&3&3&2&1&0&0&0&0\cr 2&2&2&1&0&0&0&0&0\cr 1&1&1&0&0&0&0&0&0\cr 0&0&0&0&0&0&0&0&0\cr 0&0&0&0&0&0&0&0&0\cr \end{pmatrix}
%M (%i13) /*
%M plot3d (z,   [x,0,8],   [y,0,11]);
%M */
%L maximahead:sa("Q1 2", "")
\pu

%M (%i13) /* (1c) */
%M             [zr_=z_C, zr_=z_E];
%M (%o13) \left[ \mathrm{zr\_}=y-x+1 , \mathrm{zr\_}=2\,y-12 \right] 
%M (%i14)       solve([zr_=z_C, zr_=z_E], [y,zr_]);
%M (%o14) \left[ \left[ y=13-x , \mathrm{zr\_}=14-2\,x \right]  \right] 
%M (%i15) eqc : solve([zr_=z_C, zr_=z_E], [y,zr_])[1];
%M (%o15) \left[ y=13-x , \mathrm{zr\_}=14-2\,x \right] 
%M (%i16) define(yr_(x), subst(eqc, y));
%M (%o16) \mathrm{yr\_}\left(x\right):=13-x
%M (%i17) define(zr_(x), subst(eqc, zr_));
%M (%o17) \mathrm{zr\_}\left(x\right):=14-2\,x
%M (%i18) xyzr(x)    := [x, yr_(x), zr_(x)];
%M (%o18) \mathrm{xyzr}\left(x\right):=\left[ x , \mathrm{yr\_}\left(x\right) , \mathrm{zr\_}\left(x\right) \right] 
%M (%i19) xyzr_top   : rhs(fundef(xyzr));
%M (%o19) \left[ x , \mathrm{yr\_}\left(x\right) , \mathrm{zr\_}\left(x\right) \right] 
%L maximahead:sa("Q1 3", "")
\pu

%M (%i20) xyzr_lines : makelist(xyzr(x), x,2,9);
%M (%o20) \left[ \left[ 2 , 11 , 10 \right]  , \left[ 3 , 10 , 8 \right]  , \left[ 4 , 9 , 6 \right]  , \left[ 5 , 8 , 4 \right]  , \left[ 6 , 7 , 2 \right]  , \left[ 7 , 6 , 0 \right]  , \left[ 8 , 5 , -2 \right]  , \left[ 9 , 4 , -4 \right]  \right] 
%M (%i21) apply('matrix, append([xyzr_top], xyzr_lines));
%M (%o21) \begin{pmatrix}x&\mathrm{yr\_}\left(x\right)&\mathrm{zr\_}\left(x\right)\cr 2&11&10\cr 3&10&8\cr 4&9&6\cr 5&8&4\cr 6&7&2\cr 7&6&0\cr 8&5&-2\cr 9&4&-4\cr \end{pmatrix}
%M (%i22)  /* (1d) */
%M [x, yr_(x), zr_(x)];
%M (%o22) \left[ x , 13-x , 14-2\,x \right] 
%L maximahead:sa("Q1 4", "")
\pu

%M (%i23) /* (1e) */
%M define(z(x,y), z);
%M (%o23) z\left(x , y\right):=\mathrm{min}\left(6 , \mathrm{max}\left(0 , \mathrm{min}\left(\mathrm{max}\left(\mathrm{min}\left(y-4 , 2\,y-12\right) , y-x+1\right) , y-1\right)\right)\right)
%M (%i24) eps : 1/4;
%M (%o24) {\frac{1}{4}}
%M (%i25) z_xr (x,y) := (z(x+eps,y)-z(x,y))/ eps;
%M (%o25) \mathrm{z\_xr}\left(x , y\right):={\frac{z\left(x+\mathrm{eps} , y\right)-z\left(x , y\right)}{\mathrm{eps}}}
%M (%i26) z_xl (x,y) := (z(x-eps,y)-z(x,y))/-eps;
%M (%o26) \mathrm{z\_xl}\left(x , y\right):={\frac{z\left(x-\mathrm{eps} , y\right)-z\left(x , y\right)}{-\mathrm{eps}}}
%M (%i27) z_yu (x,y) := (z(x,y+eps)-z(x,y))/ eps;
%M (%o27) \mathrm{z\_yu}\left(x , y\right):={\frac{z\left(x , y+\mathrm{eps}\right)-z\left(x , y\right)}{\mathrm{eps}}}
%M (%i28) z_yd (x,y) := (z(x,y-eps)-z(x,y))/-eps;
%M (%o28) \mathrm{z\_yd}\left(x , y\right):={\frac{z\left(x , y-\mathrm{eps}\right)-z\left(x , y\right)}{-\mathrm{eps}}}
%M (%i29) gradz(x,y) := if (z_xr(x,y) = z_xl(x,y)) and
%M                  (z_yu(x,y) = z_yd(x,y))
%M               then [z_xr(x,y), z_yu(x,y)]
%M               else "X"$
%L maximahead:sa("Q1 5", "")
\pu

%M (%i30) mkmatrix5(x,seq(0,8), y,seqby(11,0,-1), gradz(x,y));
%M (%o30) \begin{pmatrix}\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] \cr \left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\mbox{ X }&\mbox{ X }&\mbox{ X }&\mbox{ X }\cr \left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\mbox{ X }&\mbox{ X }&\left[ 0 , 1 \right] &\left[ 0 , 1 \right] &\left[ 0 , 1 \right] \cr \left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\mbox{ X }&\left[ -1 , 1 \right] &\mbox{ X }&\mbox{ X }&\mbox{ X }&\mbox{ X }\cr \mbox{ X }&\mbox{ X }&\mbox{ X }&\left[ -1 , 1 \right] &\left[ -1 , 1 \right] &\left[ -1 , 1 \right] &\mbox{ X }&\left[ 0 , 2 \right] &\left[ 0 , 2 \right] \cr \left[ 0 , 1 \right] &\left[ 0 , 1 \right] &\mbox{ X }&\left[ -1 , 1 \right] &\left[ -1 , 1 \right] &\left[ -1 , 1 \right] &\left[ -1 , 1 \right] &\mbox{ X }&\mbox{ X }\cr \left[ 0 , 1 \right] &\left[ 0 , 1 \right] &\mbox{ X }&\left[ -1 , 1 \right] &\left[ -1 , 1 \right] &\left[ -1 , 1 \right] &\mbox{ X }&\left[ 0 , 0 \right] &\left[ 0 , 0 \right] \cr \left[ 0 , 1 \right] &\left[ 0 , 1 \right] &\mbox{ X }&\left[ -1 , 1 \right] &\left[ -1 , 1 \right] &\mbox{ X }&\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] \cr \left[ 0 , 1 \right] &\left[ 0 , 1 \right] &\mbox{ X }&\left[ -1 , 1 \right] &\mbox{ X }&\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] \cr \left[ 0 , 1 \right] &\left[ 0 , 1 \right] &\mbox{ X }&\mbox{ X }&\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] \cr \mbox{ X }&\mbox{ X }&\mbox{ X }&\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] \cr \left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] &\left[ 0 , 0 \right] \cr \end{pmatrix}
%M (%i31) 
%M /* (1f) */
%M [xmin,xmax, ymin,ymax] : [0,9, 0,7];
%M (%o31) \left[ 0 , 9 , 0 , 7 \right] 
%M (%i32) Q(t) := [0,2] + t*[1,1];
%M (%o32) Q\left(t\right):=\left[ 0 , 2 \right] +t\,\left[ 1 , 1 \right] 
%M (%i33) define(xQ(t), Q(t)[1]);
%M (%o33) \mathrm{xQ}\left(t\right):=t
%M (%i34) define(yQ(t), Q(t)[2]);
%M (%o34) \mathrm{yQ}\left(t\right):=t+2
%M (%i35)                    [x=xQ(t),x=yQ(t)];
%M (%o35) \left[ x=t , x=t+2 \right] 
%L maximahead:sa("Q1 6", "")
\pu

%M (%i36) define(h(t), at(z, [x=xQ(t),y=yQ(t)]));
%M (%o36) h\left(t\right):=\mathrm{min}\left(6 , \mathrm{max}\left(0 , \mathrm{min}\left(\mathrm{max}\left(3 , \mathrm{min}\left(t-2 , 2\,\left(t+2\right)-12\right)\right) , t+1\right)\right)\right)
%M (%i37) myqdrawp(xyrange(), myex1(h(x), lc(red)));
%M (%o37) \myvcenter{\includegraphics[height=5cm]{2024-2-C3/P1-Q1_001.pdf}}
%M (%i38) 
%L maximahead:sa("Q1 7", "")
\pu


% «gab-1-p2»  (to ".gab-1-p2")
% (c3m242p1p 8 "gab-1-p2")
% (c3m242p1a   "gab-1-p2")

{\bf Questão 1: gabarito (2)}

\scalebox{0.4}{\def\colwidth{13cm}\firstcol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q1}

}\anothercol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q1 2}

}}

\newpage

% «gab-1-p3»  (to ".gab-1-p3")
% (c3m242p1p 9 "gab-1-p3")
% (c3m242p1a   "gab-1-p3")

{\bf Questão 1: gabarito (3)}

\scalebox{0.4}{\def\colwidth{12cm}\firstcol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q1 3}

}\anothercol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q1 4}

}}

\newpage

% «gab-1-p4»  (to ".gab-1-p4")
% (c3m242p1p 10 "gab-1-p4")
% (c3m242p1a    "gab-1-p4")

{\bf Questão 1: gabarito (4)}

\scalebox{0.38}{\def\colwidth{14cm}\firstcol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q1 5}

}\anothercol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q1 6}

}}

\newpage

% «gab-1-p5»  (to ".gab-1-p5")
% (c3m242p1p 11 "gab-1-p5")
% (c3m242p1a    "gab-1-p5")

{\bf Questão 1: gabarito (5)}

\scalebox{0.4}{\def\colwidth{14cm}\firstcol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q1 7}

}\anothercol{
}}


\newpage

%M (%i1) mkmatrix5(x,xs,y,ys,expr) ::=
%M   buildq([x,xs,y,ys,expr],
%M          apply('matrix,
%M                makelist(makelist(expr,x,xs),y,ys)))$
%M (%i2) 
%M /* Algumas definicoes */
%M gradef(W  (x,y), W_x (x,y), W_y (x,y))$
%M (%i3) gradef(W_x(x,y), W_xx(x,y), W_xy(x,y))$
%M (%i4) gradef(W_y(x,y), W_xy(x,y), W_yy(x,y))$
%M (%i5) diff6(F)         := [F,
%M                      diff(F,x),   diff(F,y),
%M                      diff(F,x,2), diff(F,x,1,y,1), diff(F,y,2)]$
%M (%i6) M6_(a,b,c,d,e,f) := matrix([a,"",""], [b,c,""], [d,e,f])$
%M (%i7) T6_(a,b,c,d,e,f) := a + b*Dx + c*Dy + d*Dx^2/2 + e*Dx*Dy + f*Dy^2$
%M (%i8) M6 (abcdef)      := apply('M6_, abcdef)$
%M (%i9) T6 (abcdef)      := apply('T6_, abcdef)$
%M (%i10) atxy(expr,x0y0)  := at(expr, [x=x0y0[1], y=x0y0[2]])$
%M (%i11) D2(F)            := M6(diff6(F))$
%M (%i12) T2(x0y0,F)       := T6(atxy(diff6(F),x0y0))$
%M (%i13) DxDyat(x0y0)     := [Dx=x-x0y0[1], Dy=y-x0y0[2]]$
%M (%i14) T2exp(x0y0,F)    := subst(DxDyat(x0y0), T2(x0y0,F))$
%M 
%M (%i15) 
%M M6_ (1,2,3,4,5,6);
%M (%o15) \begin{pmatrix}1&&\cr 2&3&\cr 4&5&6\cr \end{pmatrix}
%M (%i16) M6 ([1,2,3,4,5,6]);
%M (%o16) \begin{pmatrix}1&&\cr 2&3&\cr 4&5&6\cr \end{pmatrix}
%L maximahead:sa("Q2", "")
\pu

%M (%i17)         D2(W(x,y));
%M (%o17) \begin{pmatrix}W\left(x , y\right)&&\cr \mathrm{W\_x}\left(x , y\right)&\mathrm{W\_y}\left(x , y\right)&\cr \mathrm{W\_xx}\left(x , y\right)&\mathrm{W\_xy}\left(x , y\right)&\mathrm{W\_yy}\left(x , y\right)\cr \end{pmatrix}
%M (%i18)      diff6(W(x,y));
%M (%o18) \left[ W\left(x , y\right) , \mathrm{W\_x}\left(x , y\right) , \mathrm{W\_y}\left(x , y\right) , \mathrm{W\_xx}\left(x , y\right) , \mathrm{W\_xy}\left(x , y\right) , \mathrm{W\_yy}\left(x , y\right) \right] 
%M (%i19) atxy(diff6(W(x,y)),[x0,y0]);
%M (%o19) \left[ W\left(\mathrm{x0} , \mathrm{y0}\right) , \mathrm{W\_x}\left(\mathrm{x0} , \mathrm{y0}\right) , \mathrm{W\_y}\left(\mathrm{x0} , \mathrm{y0}\right) , \mathrm{W\_xx}\left(\mathrm{x0} , \mathrm{y0}\right) , \mathrm{W\_xy}\left(\mathrm{x0} , \mathrm{y0}\right) , \mathrm{W\_yy}\left(\mathrm{x0} , \mathrm{y0}\right) \right] 
%M (%i20) DxDyat([3,4]);
%M (%o20) \left[ \mathrm{Dx}=x-3 , \mathrm{Dy}=y-4 \right] 
%M (%i21) T2    ([3,4],W(x,y));
%M (%o21) \scalebox{0.7}{$\mathrm{W\_yy}\left(3 , 4\right)\,\mathrm{Dy}^2+\mathrm{W\_xy}\left(3 , 4\right)\,\mathrm{Dx}\,\mathrm{Dy}+\mathrm{W\_y}\left(3 , 4\right)\,\mathrm{Dy}+{\frac{\mathrm{W\_xx}\left(3 , 4\right)\,\mathrm{Dx}^2}{2}}+\mathrm{W\_x}\left(3 , 4\right)\,\mathrm{Dx}+W\left(3 , 4\right)$}
%M (%i22) T2exp ([3,4],W(x,y));
%M (%o22) \scalebox{0.7}{$\mathrm{W\_xy}\left(3 , 4\right)\,\left(x-3\right)\,\left(y-4\right)+\mathrm{W\_y}\left(3 , 4\right)\,\left(y-4\right)+\mathrm{W\_yy}\left(3 , 4\right)\,\left(y-4\right)^2+\mathrm{W\_x}\left(3 , 4\right)\,\left(x-3\right)+{\frac{\mathrm{W\_xx}\left(3 , 4\right)\,\left(x-3\right)^2}{2}}+W\left(3 , 4\right)$}
%L maximahead:sa("Q2 2", "")
\pu

%M (%i23) F  : x*y*(6 -2*x -y);
%M (%o23) x\,\left(-y-2\,x+6\right)\,y
%M (%i24) F  : expand(F);
%M (%o24) -\left(x\,y^2\right)-2\,x^2\,y+6\,x\,y
%M (%i25) P1 : [0,6]$
%M (%i26) P2 : [1,2]$
%M (%i27) P3 : [3,0]$
%M (%i28) P4 : [0,0]$
%M (%i29) 
%M /* (2a) */
%M D2F   :      D2(F);
%M (%o29) \begin{pmatrix}-\left(x\,y^2\right)-2\,x^2\,y+6\,x\,y&&\cr -y^2-4\,x\,y+6\,y&-\left(2\,x\,y\right)-2\,x^2+6\,x&\cr -\left(4\,y\right)&-\left(2\,y\right)-4\,x+6&-\left(2\,x\right)\cr \end{pmatrix}
%M (%i30) 
%M /* (2b) */
%M D2FP1 : atxy(D2(F),P1);
%M (%o30) \begin{pmatrix}0&&\cr 0&0&\cr -24&-6&0\cr \end{pmatrix}
%M (%i31) D2FP2 : atxy(D2(F),P2);
%M (%o31) \begin{pmatrix}4&&\cr 0&0&\cr -8&-2&-2\cr \end{pmatrix}
%M (%i32) D2FP3 : atxy(D2(F),P3);
%M (%o32) \begin{pmatrix}0&&\cr 0&0&\cr 0&-6&-6\cr \end{pmatrix}
%M (%i33) D2FP4 : atxy(D2(F),P4);
%M (%o33) \begin{pmatrix}0&&\cr 0&0&\cr 0&6&0\cr \end{pmatrix}
%L maximahead:sa("Q2 3", "")
\pu

%M (%i34) /* (2c) */
%M T2(P1,F);
%M (%o34) -\left(6\,\mathrm{Dx}\,\mathrm{Dy}\right)-12\,\mathrm{Dx}^2
%M (%i35) T2(P2,F);
%M (%o35) -\left(2\,\mathrm{Dy}^2\right)-2\,\mathrm{Dx}\,\mathrm{Dy}-4\,\mathrm{Dx}^2+4
%M (%i36) T2(P3,F);
%M (%o36) -\left(6\,\mathrm{Dy}^2\right)-6\,\mathrm{Dx}\,\mathrm{Dy}
%M (%i37) T2(P4,F);
%M (%o37) 6\,\mathrm{Dx}\,\mathrm{Dy}
%M (%i38) 
%M /* (2d) */
%M grad(F) := [diff(F,x),diff(F,y)]$
%M (%i39)    H(F) := hessian(F, [x,y])$
%M (%i40) detH(F) := determinant(H(F))$
%M (%i41) crit(F) := [F, grad(F), H(F), detH(F)]$
%M 
%M (%i42) crit(W(x,y));
%M (%o42) \scalebox{0.7}{$\left[ W\left(x , y\right) , \left[ \mathrm{W\_x}\left(x , y\right) , \mathrm{W\_y}\left(x , y\right) \right]  , \begin{pmatrix}\mathrm{W\_xx}\left(x , y\right)&\mathrm{W\_xy}\left(x , y\right)\cr \mathrm{W\_xy}\left(x , y\right)&\mathrm{W\_yy}\left(x , y\right)\cr \end{pmatrix} , \mathrm{W\_xx}\left(x , y\right)\,\mathrm{W\_yy}\left(x , y\right)-\mathrm{W\_xy}\left(x , y\right)^2 \right]$}
%M (%i43) atxy(crit(F), P1);
%M (%o43) \left[ 0 , \left[ 0 , 0 \right]  , \begin{pmatrix}-24&-6\cr -6&0\cr \end{pmatrix} , -36 \right] 
%M (%i44) atxy(crit(F), P2);
%M (%o44) \left[ 4 , \left[ 0 , 0 \right]  , \begin{pmatrix}-8&-2\cr -2&-2\cr \end{pmatrix} , 12 \right] 
%M (%i45) atxy(crit(F), P3);
%M (%o45) \left[ 0 , \left[ 0 , 0 \right]  , \begin{pmatrix}0&-6\cr -6&-6\cr \end{pmatrix} , -36 \right] 
%M (%i46) atxy(crit(F), P4);
%M (%o46) \left[ 0 , \left[ 0 , 0 \right]  , \begin{pmatrix}0&6\cr 6&0\cr \end{pmatrix} , -36 \right] 
%L maximahead:sa("Q2 4", "")
\pu

%M (%i47) 
%M /* (2e), preparacao */
%M F;
%M (%o47) -\left(x\,y^2\right)-2\,x^2\,y+6\,x\,y
%M (%i48)     T2   (P2,F);
%M (%o48) -\left(2\,\mathrm{Dy}^2\right)-2\,\mathrm{Dx}\,\mathrm{Dy}-4\,\mathrm{Dx}^2+4
%M (%i49) G : T2exp(P2,F);
%M (%o49) -\left(2\,\left(x-1\right)\,\left(y-2\right)\right)-2\,\left(y-2\right)^2-4\,\left(x-1\right)^2+4
%M (%i50) G : expand(G);
%M (%o50) -\left(2\,y^2\right)-2\,x\,y+10\,y-4\,x^2+12\,x-12
%M (%i51) 
%M atxy(D2(F),P2);
%M (%o51) \begin{pmatrix}4&&\cr 0&0&\cr -8&-2&-2\cr \end{pmatrix}
%M (%i52) atxy(D2(G),P2);
%M (%o52) \begin{pmatrix}4&&\cr 0&0&\cr -8&-2&-4\cr \end{pmatrix}
%M (%i53) 
%M numsB(expr) :=
%M   apply(matrix,
%M         makelist(makelist(ev(expr), x,0,3),
%M                  y, seqby(6,0,-1)))$
%M 
%M (%i54) numsB([x,y]);
%M (%o54) \begin{pmatrix}\left[ 0 , 6 \right] &\left[ 1 , 6 \right] &\left[ 2 , 6 \right] &\left[ 3 , 6 \right] \cr \left[ 0 , 5 \right] &\left[ 1 , 5 \right] &\left[ 2 , 5 \right] &\left[ 3 , 5 \right] \cr \left[ 0 , 4 \right] &\left[ 1 , 4 \right] &\left[ 2 , 4 \right] &\left[ 3 , 4 \right] \cr \left[ 0 , 3 \right] &\left[ 1 , 3 \right] &\left[ 2 , 3 \right] &\left[ 3 , 3 \right] \cr \left[ 0 , 2 \right] &\left[ 1 , 2 \right] &\left[ 2 , 2 \right] &\left[ 3 , 2 \right] \cr \left[ 0 , 1 \right] &\left[ 1 , 1 \right] &\left[ 2 , 1 \right] &\left[ 3 , 1 \right] \cr \left[ 0 , 0 \right] &\left[ 1 , 0 \right] &\left[ 2 , 0 \right] &\left[ 3 , 0 \right] \cr \end{pmatrix}
%L maximahead:sa("Q2 5", "")
\pu

%M (%i55) 
%M /* (2e) */
%M numsB(F);
%M (%o55) \begin{pmatrix}0&-12&-48&-108\cr 0&-5&-30&-75\cr 0&0&-16&-48\cr 0&3&-6&-27\cr 0&4&0&-12\cr 0&3&2&-3\cr 0&0&0&0\cr \end{pmatrix}
%M (%i56) 
%M /* (2f) */
%M numsB(G);
%M (%o56) \begin{pmatrix}-24&-28&-40&-60\cr -12&-14&-24&-42\cr -4&-4&-12&-28\cr 0&2&-4&-18\cr 0&4&0&-12\cr -4&2&0&-10\cr -12&-4&-4&-12\cr \end{pmatrix}
%M (%i57) 
%M /* (2g) */
%M [xmin,ymin, xmax,ymax] : [-1,-1, 4,7]$
%M 
%M (%i58) level(zz,color) := myimp1(F=zz, lc(color), lk(z=zz))$
%M (%i59) levels() := [level( 3.95, gray),
%M              level( 3.90, gray),
%M              level( 3.85, gray),
%M              level( 3,    red),
%M              level( 2,    orange),
%M              level( 1,    gold),
%M              level( 0,    forest_green),
%M              level(-1,    blue)]$
%L maximahead:sa("Q2 6", "")
\pu

%M (%i60) 
%M /* As curvas de nivel da F, sem os vetores gradientes: */
%M level(zz,color) := myimp1(F=zz, lc(color), lk(z=zz))$
%M 
%M (%i61) myqdrawp(xyrange(), levels());
%M (%o61) \myvcenter{\includegraphics[height=8cm]{2024-2-C3/P1-Q2_001.pdf}}
%M (%i62) 
%M /* As curvas de nivel da G, sem os vetores gradientes: */
%M level(zz,color) := myimp1(G=zz, lc(color), lk(z=zz))$
%M 
%M (%i63) myqdrawp(xyrange(), levels());
%M (%o63) \myvcenter{\includegraphics[height=8cm]{2024-2-C3/P1-Q2_002.pdf}}
%L maximahead:sa("Q2 7", "")
\pu

%M (%i64) /* Os conjuntos B e C: */
%M B : create_list([x,y], y,seqby(6,0,-1), x,seq(0,3));
%M (%o64) \scalebox{0.5}{$\left[ \left[ 0 , 6 \right]  , \left[ 1 , 6 \right]  , \left[ 2 , 6 \right]  , \left[ 3 , 6 \right]  , \left[ 0 , 5 \right]  , \left[ 1 , 5 \right]  , \left[ 2 , 5 \right]  , \left[ 3 , 5 \right]  , \left[ 0 , 4 \right]  , \left[ 1 , 4 \right]  , \left[ 2 , 4 \right]  , \left[ 3 , 4 \right]  , \left[ 0 , 3 \right]  , \left[ 1 , 3 \right]  , \left[ 2 , 3 \right]  , \left[ 3 , 3 \right]  , \left[ 0 , 2 \right]  , \left[ 1 , 2 \right]  , \left[ 2 , 2 \right]  , \left[ 3 , 2 \right]  , \left[ 0 , 1 \right]  , \left[ 1 , 1 \right]  , \left[ 2 , 1 \right]  , \left[ 3 , 1 \right]  , \left[ 0 , 0 \right]  , \left[ 1 , 0 \right]  , \left[ 2 , 0 \right]  , \left[ 3 , 0 \right]  \right]$}
%M (%i65) eq1 : y = 6 - 2*x;
%M (%o65) y=6-2\,x
%M (%i66) eq2 : solve(eq1,x);
%M (%o66) \left[ x=-\left({\frac{y-6}{2}}\right) \right] 
%M (%i67) subst(eq2, x);
%M (%o67) -\left({\frac{y-6}{2}}\right)
%M (%i68) define(xmaxC(y), subst(eq2, x));
%M (%o68) \mathrm{xmaxC}\left(y\right):=-\left({\frac{y-6}{2}}\right)
%M (%i69) C : create_list([x,y], y,seqby(6,0,-1), x,seq(0,xmaxC(y)));
%M (%o69) \left[ \left[ 0 , 6 \right]  , \left[ 0 , 5 \right]  , \left[ 0 , 4 \right]  , \left[ 1 , 4 \right]  , \left[ 0 , 3 \right]  , \left[ 1 , 3 \right]  , \left[ 0 , 2 \right]  , \left[ 1 , 2 \right]  , \left[ 2 , 2 \right]  , \left[ 0 , 1 \right]  , \left[ 1 , 1 \right]  , \left[ 2 , 1 \right]  , \left[ 0 , 0 \right]  , \left[ 1 , 0 \right]  , \left[ 2 , 0 \right]  , \left[ 3 , 0 \right]  \right]
%M (%i70) 
%M [myqdrawp(xyrange(), pts(B, pc(red), myps(3))),
%M  myqdrawp(xyrange(), pts(C, pc(red), myps(3)))];
%M (%o70) \left[ \myvcenter{\includegraphics[height=5cm]{2024-2-C3/P1-Q2_003.pdf}} , \myvcenter{\includegraphics[height=5cm]{2024-2-C3/P1-Q2_004.pdf}} \right] 
%L maximahead:sa("Q2 8", "")
\pu


%M (%i71) /* O gradiente da F nos pontos de B: */
%M numsB(     grad(F)       );
%M (%o71) \begin{pmatrix}\left[ 0 , 0 \right] &\left[ -24 , -8 \right] &\left[ -48 , -20 \right] &\left[ -72 , -36 \right] \cr \left[ 5 , 0 \right] &\left[ -15 , -6 \right] &\left[ -35 , -16 \right] &\left[ -55 , -30 \right] \cr \left[ 8 , 0 \right] &\left[ -8 , -4 \right] &\left[ -24 , -12 \right] &\left[ -40 , -24 \right] \cr \left[ 9 , 0 \right] &\left[ -3 , -2 \right] &\left[ -15 , -8 \right] &\left[ -27 , -18 \right] \cr \left[ 8 , 0 \right] &\left[ 0 , 0 \right] &\left[ -8 , -4 \right] &\left[ -16 , -12 \right] \cr \left[ 5 , 0 \right] &\left[ 1 , 2 \right] &\left[ -3 , 0 \right] &\left[ -7 , -6 \right] \cr \left[ 0 , 0 \right] &\left[ 0 , 4 \right] &\left[ 0 , 4 \right] &\left[ 0 , 0 \right] \cr \end{pmatrix}
%M (%i72) numsB(atxy(grad(F),[x,y]));
%M (%o72) \begin{pmatrix}\left[ 0 , 0 \right] &\left[ -24 , -8 \right] &\left[ -48 , -20 \right] &\left[ -72 , -36 \right] \cr \left[ 5 , 0 \right] &\left[ -15 , -6 \right] &\left[ -35 , -16 \right] &\left[ -55 , -30 \right] \cr \left[ 8 , 0 \right] &\left[ -8 , -4 \right] &\left[ -24 , -12 \right] &\left[ -40 , -24 \right] \cr \left[ 9 , 0 \right] &\left[ -3 , -2 \right] &\left[ -15 , -8 \right] &\left[ -27 , -18 \right] \cr \left[ 8 , 0 \right] &\left[ 0 , 0 \right] &\left[ -8 , -4 \right] &\left[ -16 , -12 \right] \cr \left[ 5 , 0 \right] &\left[ 1 , 2 \right] &\left[ -3 , 0 \right] &\left[ -7 , -6 \right] \cr \left[ 0 , 0 \right] &\left[ 0 , 4 \right] &\left[ 0 , 4 \right] &\left[ 0 , 0 \right] \cr \end{pmatrix}
%M (%i73) 
%M /* O gradiente da F nos pontos de C: */
%M define(v_at (xy), atxy(grad(F)/10,xy))$
%M 
%M (%i74) define(Pv_at(xy), myPv(xy,v_at(xy),[ps(1)],hl(0.15)))$
%M 
%M (%i75) Pv_at([1,3]);
%M (%o75) \left[ \mathrm{pts}\left(\left[ \left[ 1 , 3 \right]  \right]  , \mathrm{ps}\left(1\right)\right) , \mathrm{vector}\left(\left[ 1 , 3 \right]  , \left[ -\left({\frac{3}{10}}\right) , -\left({\frac{1}{5}}\right) \right]  , \mathrm{hl}\left(0.15\right)\right) \right] 
%M (%i76) grads_at_C : makelist(Pv_at(xy), xy, C)$
%L maximahead:sa("Q2 9", "")
\pu

%M (%i77) myqdrawp(xyrange(), grads_at_C);
%M (%o77) \myvcenter{\includegraphics[height=5cm]{2024-2-C3/P1-Q2_005.pdf}}
%M (%i78) 
%M /* O gradiente da F nos pontos de C e as curvas de nivel: */
%M level(zz,color) := myimp1(F=zz, lc(color), lk(z=zz))$
%M 
%M (%i79) myqdrawp(xyrange(), levels(), grads_at_C);
%M (%o79) \myvcenter{\includegraphics[height=5cm]{2024-2-C3/P1-Q2_006.pdf}}
%M (%i80) 
%L maximahead:sa("Q2 10", "")
\pu

{\bf Questão 2: gabarito}

\scalebox{0.35}{\def\colwidth{16cm}\firstcol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q2}

}\anothercol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q2 2}

}}


\newpage

{\bf Questão 2: gabarito (2)}

\scalebox{0.3}{\def\colwidth{16cm}\firstcol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q2 3}

}\anothercol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q2 4}

}}


\newpage

{\bf Questão 2: gabarito (3)}

\scalebox{0.3}{\def\colwidth{16cm}\firstcol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q2 5}

}\anothercol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q2 6}

}}


\newpage

{\bf Questão 2: gabarito (3)}

\scalebox{0.3}{\def\colwidth{16cm}\firstcol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q2 7}

}\anothercol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q2 8}

}}


\newpage

{\bf Questão 2: gabarito (4)}

\scalebox{0.3}{\def\colwidth{16cm}\firstcol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q2 9}

}\anothercol{

\vspace*{0cm}
\def\hboxthreewidth {14cm}
\ga{Q2 10}

}}


\newpage


\GenericWarning{Success:}{Success!!!}  % Used by `M-x cv'

\end{document}

% (find-pdfpages2-links "~/LATEX/" "2024-2-C3-P1")


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
mygr  () { grep 'c3m.*\(p1\|p2\|vr\|vs\)' ~/blogme3/code-etex-tlas.lua; }
myawk () { awk -F '"' '{print "(" $2 "p)" }'; }
mygr | myawk

% (c3m201p2p)
% (c3m202p1p)
% (c3m202p2p)
% (c3m211p1p)
% (c3m211p2p)
% (c3m212p1p)
% (c3m212p2p)
% (c3m212vsp)
% (c3m221p1p)
% (c3m221p2p)
% (c3m221vrp)
% (c3m221vsp)
% (c3m221vsbp)
% (c3m222dicasp1p)
% (c3m222p1p)
% (c3m222dicasp2p)
% (c3m222p2p)
% (c3m222vrp)
% (c3m222vsp)
% (c3m232dicasp1p)
% (c3m232p1p)
% (c3m232dicasp2p)
% (c3m232p2p)
% (c3m241rp1p)
% (c3m241dicasp1p)
% (c3m241p1p)
% (c3m241p2p)
% (c3m241vrp1p)
% (c3m241vrp2p)
% (c3m241vsp)
% (c3m242dicasp1p)
(c3m201p2p)
(c3m202p1p)
(c3m202p2p)
(c3m211p1p)
(c3m211p2p)
(c3m212p1p)
(c3m212p2p)
(c3m212vsp)

(c3m221p1p)
(c3m221p2p)
(c3m221vrp)
(c3m221vsp)
(c3m221vsbp)
(c3m222dicasp1p)
(c3m222p1p)
(c3m222dicasp2p)
(c3m222p2p)
(c3m222vrp)
(c3m222vsp)
(c3m232dicasp1p)
(c3m232p1p)
(c3m232dicasp2p)
(c3m232p2p)
(c3m241rp1p)
(c3m241dicasp1p)
(c3m241p1p)
(c3m241p2p)
(c3m241vrp1p)
(c3m241vrp2p)
(c3m241vsp)
(c3m242dicasp1p)




% Local Variables:
% coding: utf-8-unix
% ee-tla: "c3p1"
% ee-tla: "c3m242p1"
% End: