4

I use tkz-fct but it produces weird result. I changed the code as indicated by Alain Matthes and it works for Area behind a curve but it doesn't work for Area between curves :

\documentclass[10pt,a4paper]{article}
\usepackage{tikz,tkz-tab,tkz-fct}
\begin{tikzpicture}[scale=1.3]
   \tkzInit[xmin=-1,xmax=4,ymin=0,ymax=5]
   \tkzGrid
   \tkzAxeXY
   \tkzFct[domain = -.5:4]{ 4*x-x**2+4/(x**2+1)**2}
   \tkzFct[domain = -.5:4]{x-1+4/(x**2+1)**2}
   \tkzDrawAreafg[color=green,domain = 1:3]
   \tkzRep
   \tkzText(5.2,3.5){$\displaystyle{\int_{1}^3 f(x)-g(x)dx}$}
   \draw [->] (4.1,3.5) -- (2.6,3);
   \tkzText(2.5,4.2){$\mathscr{C}_f$}
   \tkzText(2.5,1.2){$\mathscr{C}_g$}
\end{tikzpicture}
\end{document}

Picture of the result

Please, could someone help me ?

yg60
  • 113

1 Answers1

1

Once you fix the MWE [missing a package 'mathrsfs' and a opening document], it works just fine on XeLaTeX on Ubuntu...

So anything else to your issue?

\documentclass[10pt,a4paper]{article}
\usepackage{tikz,tkz-tab,tkz-fct,mathrsfs}
\begin{document}
\begin{tikzpicture}[scale=1.3]
   \tkzInit[xmin=-1,xmax=4,ymin=0,ymax=5]
   \tkzGrid
 \tkzAxeXY
 \tkzFct[domain = -.5:4]{ 4*x-x**2+4/(x**2+1)**2}
 \tkzFct[domain = -.5:4]{x-1+4/(x**2+1)**2}
 \tkzDrawAreafg[color=green,domain = 1:3]
 \tkzRep
 \tkzText(5.2,3.5){$\displaystyle{\int_{1}^3 f(x)-g(x)dx}$}
 \draw [->] (4.1,3.5) -- (2.6,3);
 \tkzText(2.5,4.2){$\mathscr{C}_f$}
 \tkzText(2.5,1.2){$\mathscr{C}_g$}
\end{tikzpicture}
\end{document}

Generated Output Graph