From d6c61d988bfa4255baf9cdae42db59ebee38363f Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 25 May 2021 17:10:49 +0200 Subject: Added files --- .../Homework4-solutions-checkpoint.ipynb | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/Homework4/.ipynb_checkpoints/Homework4-solutions-checkpoint.ipynb (limited to 'src/Homework4/.ipynb_checkpoints/Homework4-solutions-checkpoint.ipynb') diff --git a/src/Homework4/.ipynb_checkpoints/Homework4-solutions-checkpoint.ipynb b/src/Homework4/.ipynb_checkpoints/Homework4-solutions-checkpoint.ipynb new file mode 100644 index 0000000..f8617fd --- /dev/null +++ b/src/Homework4/.ipynb_checkpoints/Homework4-solutions-checkpoint.ipynb @@ -0,0 +1,61 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "f(x) \t Derivative \t Integral \t Series expansion\n", + "e^x \t e^x \t e^x \t 1 + 1*x + 1/2*x^2 + 1/6*x^3 + 1/24*x^4 + Order(x^5)\n", + "sin(x) \t cos(x) \t -cos(x) \t 1*x + (-1/6)*x^3 + Order(x^5)\n", + "cos(x) \t -sin(x) \t sin(x) \t 1 + (-1/2)*x^2 + 1/24*x^4 + Order(x^5)\n", + "tan(x) \t tan(x)^2 + 1 \t log(sec(x)) \t 1*x + 1/3*x^3 + Order(x^5)\n", + "log(x + 1) \t 1/(x + 1) \t (x + 1)*log(x + 1) - x - 1 \t 1*x + (-1/2)*x^2 + 1/3*x^3 + (-1/4)*x^4 + Order(x^5)\n", + "(x + 1)^a \t a*(x + 1)^(a - 1) \t (x + 1)^(a + 1)/(a + 1) \t 1 + (a)*x + (1/2*a^2 - 1/2*a)*x^2 + (1/6*a^3 - 1/2*a^2 + 1/3*a)*x^3 + (1/24*a^4 - 1/4*a^3 + 11/24*a^2 - 1/4*a)*x^4 + Order(x^5)\n" + ] + } + ], + "source": [ + "print(\"f(x)\", \"\\t\", \"Derivative\", \"\\t\", \"Integral\", \"\\t\", \"Series expansion\")\n", + "var('a')\n", + "f(x) = (1+x)^a\n", + "assume(a>0)\n", + "functions = [e^x, sin, cos, tan, log(1+x), f]\n", + "for g in functions:\n", + " print(g(x), \"\\t\", derivative(g(x), x), \"\\t\", integral(g(x),x), \"\\t\", g(x).series(x==0,5))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "SageMath 9.2", + "language": "sage", + "name": "sagemath" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.5" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} -- cgit v1.3