Piecewise functions =================== #. Write the function :py:func:`fun_mat_1` that takes an ``x`` value (float), and returns ``f(x)`` (float). .. math:: f(x) = \begin{cases} \frac{5x-1}{\sqrt{\lvert x-1 \rvert}} & x<=-1 \\ 2^{x} & x>-1 \end{cases} Save this function into a file named ``fun_mat_1.py``. See the following examples: .. literalinclude:: fun_mat_1.txt :language: python3 :lines: 3- .. note:: More tests are provided in the :download:`fun_mat_1.txt` file #. Write the function :py:func:`fun_mat_2` that takes two values ``x`` and ``y`` (float), and returns ``g(x, y)`` (float). .. math:: g(x,y) = \begin{cases} \frac{x^2-y^2}{e^{x+y}-1} & x>-y, \\ 2^x & x=-y, \\ \frac{\sin (x^2-y^2)}{x+y} & x<-y. \end{cases} Save this function into a file named ``fun_mat_2.py``. See the following examples: .. literalinclude:: fun_mat_2.txt :language: python3 :lines: 3- .. note:: More tests are provided in the :download:`fun_mat_2.txt` file #. Write the function :py:func:`fun_mat_3` that takes two values ``x`` and ``y`` (float), and returns ``h(x, y)`` (float). .. math:: h(x,y) = \begin{cases} x^2+y, & \mbox{si } x>=1\\ sin(x), & \mbox{si } 0` file .. rubric:: Solution Solutions are provided in files :download:`fun_mat_1.py `, :download:`fun_mat_2.py ` and :download:`fun_mat_3.py `