How would one draw the following figure describing a wave in Tikz?

I am rather new to Tikz, and I could not find this anywhere online. How would one draw this rather complex figure meant to show a wave?

I only know how to create points and connect them with straight lines. I do not know how to make a curved line like the wave above shows, I do not know how to put labels in all the places shown in the figure and how to rotate them like with the y1 and y2, I do not know how to fill the area in blue, and I do not know how to color the top arch green. I really have no idea where to get started on this, nor do I know if Tikz can even produce such a figure. I thank all helpers and would appreciate all help on this.

Edit: here is what I have so far and also where I am stuck

\begin{tikzpicture}[scale=2.25]
\coordinate (A) at (0cm,2cm);
\coordinate (B) at (0cm,0cm);
\coordinate (C) at (2cm,0cm);
\coordinate (D) at (2cm,2cm);
\draw (A) -- (B) -- (C) -- (D);

\end{tikzpicture}

• Please show us what you try so far. (in form (of Minimal (not) Working Example). Apr 13, 2022 at 3:36
• You may want to read the TikZ manual if you haven't. Apr 13, 2022 at 3:41
• Searching for existing posts e.g. tex.stackexchange.com/questions/115554/… is okay too, but generally they tend to be quite complex, so stick with the manual and/or look up what each option in the answer does with the manual and pick only the useful ones may be easier Apr 13, 2022 at 3:43
• For the fill there's e.g. tikz pgf - Filling area under a function - TeX - LaTeX Stack Exchange Apr 13, 2022 at 3:43
• You can add text to the figure right? (although you may have to manually specify the coordinate instead of let it automatically computed which might look less neat) Apr 13, 2022 at 3:44

You can make curves with Bezier curves and you can add labels when you use nodes. I only started learning Tikz yesterday myself, but I made the following, so I'm sure you'll also be able to catch on quick;

\documentclass{article}

\usepackage{tikz}
\definecolor{water}{rgb}{0,1,1}

\begin{document}

\begin{tikzpicture}
\draw[fill=water] (0,1) .. controls (1,1.5) and (2,1.5) .. (3,1) -- (3,0) -- (0,0) -- (0,1)
node at (1.5,0.8)[]{g(x)}
node at (1.5,1.6)[]{f(x)};
\draw (0,0) -- (0,2);
\draw (3,0) -- (3,2);
\end{tikzpicture}

\end{document}


Which generates:

EDIT: To change the colour of just the curve, I'd define the curve in a separate \draw command.

\begin{tikzpicture}
\draw[fill=water, color=water] (0,1) .. controls (1,1.5) and (2,1.5) .. (3,1) -- (3,0) -- (0,0) -- (0,1)
node at (1.5,0.8)[black] {g(x)}
node at (1.5,1.6)[black]{f(x)};
\draw[color=green] (0,1) .. controls (1,1.5) and (2,1.5) .. (3,1);
\draw[black] (3,0) -- (0,0) -- (0,2);
\draw (3,0) -- (3,2);
\end{tikzpicture}

• thank you so much
– user209867
Apr 13, 2022 at 3:48
• @kroner No probs. If this is the solution you were looking for then click the check mark to indicate for future reference. I also recommend you edit the question name to make it more specific Apr 13, 2022 at 3:51
• how do I change the color of the arc?
– user209867
Apr 13, 2022 at 4:16
• @kroner see edit Apr 13, 2022 at 4:39