با درود
ویرایش فایل شما همراه با توضیحات به صورت زیر است:
![\documentclass\[a4paper,12pt\]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}\[line cap=round,line join=round,x=1cm,y=1cm\]
% محورها
\draw\[-latex\] (-2,0) -- (4,0);
\draw\[-latex\] (0,-2) -- (0,4);
% تابع
\draw\[domain=-0.2:2.5, thick\] plot(\x,{(\x-1)^3});
% خط عمودی
\draw\[thick\] (2,-0.5)--(2,3);
% --- ناحیهی رنگی s سمت راست ---
\fill\[blue!20, opacity=0.7\]
plot\[domain=1:2\] (\x,{(\x-1)^3})
-- (2,0)
-- (1,0)
-- cycle;
% --- ناحیهی رنگی s سمت چپ ---
\fill\[red!20, opacity=0.7\]
plot\[domain=0:1\] (\x,{(\x-1)^3})
-- (1,0)
-- (0,0)
-- cycle;
% برچسبها
\node at (1.85,0.3) {\small $s$};
\node at (0.3,-0.2) {\small $s$};
\end{tikzpicture}
% --- رنگآمیزی مساحت محصور برای تابع لگاریتم ---
\begin{tikzpicture}[x=1cm,y=1cm,line join=round]
% محورها
\draw[-latex] (-0.2,0) -- (5,0);
\draw[-latex] (0,-0.2) -- (0,3.2);
% خطوط افقی
\draw[dashed] (0,1) -- (4.2,1);
\node[left] at (0,1) {$e$};
% ناحیه رنگی
\fill[blue!20,opacity=0.7]
(0,0)
-- plot[domain=0:1,samples=100] ({exp(\x)},\x)
-- (0,1)
-- cycle;
% منحنی x = e^y
\draw[thick,domain=0:1,samples=100]
plot ({exp(\x)},\x);
% برچسبها
\node at (1.0,0.5) {$s$};
\node[below right] at (2.,0.8) {$y=\ln x$};
\end{tikzpicture}
\end{document}