Funcions matemàtiques ===================== Dissenyeu una funció en Python equivalent a cadascuna de les definicions de funcions matemàtiques donades. Utilitzeu el mateix nom de la definició matemàtica com a nom de les funcions en Python. Deseu totes les funcions al mateix mòdul :file:`funcmat.py`. #. :math:`f(x) = \frac{5}{2}x^4 + \frac{x^2}{6} + 7`. La funció ha de passar el següent doctest: .. literalinclude:: test-funcmat1.txt :language: python3 :lines: 3- .. note:: Podeu descarregar el fitxer amb tests :download:`test-funcmat1.txt`. #. :math:`g(x)= \frac{(3x-2)}{2} + \frac{(x-7)^3}{7} + 2` La funció ha de passar el següent doctest: .. literalinclude:: test-funcmat2.txt :language: python3 :lines: 3- .. note:: Podeu descarregar el fitxer amb tests :download:`test-funcmat2.txt`. #. :math:`h(x,y) = \frac{y \sin x}{y^2-4}`. Suposeu que el paràmetre `x` està expressat en graus. La funció ha de passar el següent doctest: .. literalinclude:: test-funcmat3.txt :language: python3 :lines: 3- .. note:: Podeu descarregar el fitxer amb tests :download:`test-funcmat3.txt`. Què passa si avaluem aquesta funció en el punt (1,2)? #. Fent crides a les funcions definides als apartats anteriors, dissenya la funció :math:`k(x)= \sqrt{f(x)}-g(x^2)`. La funció ha de passar el següent doctest: .. literalinclude:: test-funcmat4.txt :language: python3 :lines: 3- .. note:: Podeu descarregar el fitxer amb tests :download:`test-funcmat4.txt`. .. rubric:: Solucions Disposeu de solucions al fitxer :download:`funcmat.py `.