#title: Grafico #author: Irene #let: x[2] = {[-3..-1,1..3]}; y = {[-2,-1,1,2]}; f f0 = {{1/(x-#x[0]) + 1/(x-#x[1]) + #y}}; f f2 = {{ratsimp(#f0)}}; s f2s = #f2; f x0 = {{solve (1/(x-#x[0]) + 1/(x-#x[1]) + #y =0,x)}}; f x_assin_hor = {{x,solve (1/(x-#x[0]) + 1/(x-#x[1]) + #y =#y)}}; f y0 = {{ratsimp(1/(-#x[0]) + 1/(-#x[1]) + #y)}}; #question: \noindent Determine a função $f(x)=\frac{P(x)}{Q(x)},$ onde $P(x)$ e $Q(x)$ são polinómios de grau $\le 2$, corespondente ao seguinte gráfico, sabendo que $f^{-1}(0)=#x0$ e $f(0)= #y0$ . JJ: alternativamente: $f(0)= #y0$ e $f(#x_assin_hor)=#y$; \begin{tikzpicture} \begin{axis}[ restrict y to domain=-7:7, % grid, samples=1000, minor tick num=1, xlabel={$x$}, ylabel={$y$}, xtickmax=6, ytickmax=5, xmin = -7, xmax = 7, ymin = -6, ymax = 6, unbounded coords=jump, axis x line=middle, axis y line=middle] %\addplot[color=red,mark=none,domain=-7:7] {sin(x*360 / 3.14159)}; \addplot [color=red,mark=none,domain=-7:7] {#f2s}; \addplot [orange, no markers,dashed] coordinates {(#x[0],-6) (#x[0],6)}; \addplot [orange, no markers,dashed] coordinates {(#x[1],-6) (#x[1],6)}; \addplot [orange, no markers,dashed] coordinates {(-7,#y) (7,#y)}; \end{axis} \end{tikzpicture} #sugestion: #resolution: JJ: convem rever!!! $$ f(x) = #f0 = #f2 $$ #result: #Verification: #usepackage: \usepackage{pgfplots} \usepackage{tikz}