"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"HTML('')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Creación de símbolos"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Lo primero, como siempre, es importar aquello que vayamos a necesitar:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Importación\n",
"from sympy import init_session"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"IPython console for SymPy 0.7.5 (Python 3.4.2-64-bit) (ground types: python)\n",
"\n",
"These commands were executed:\n",
">>> from __future__ import division\n",
">>> from sympy import *\n",
">>> x, y, z, t = symbols('x y z t')\n",
">>> k, m, n = symbols('k m n', integer=True)\n",
">>> f, g, h = symbols('f g h', cls=Function)\n",
"\n",
"Documentation can be found at http://www.sympy.org\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING: Hook shutdown_hook is deprecated. Use the atexit module instead.\n"
]
}
],
"source": [
"init_session(use_latex=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Lo primero que vemos es que el comando `init_session` ha llevado a cabo algunas acciones por nostros:\n",
"\n",
"* Gracias a `use_latex=True` obtenemos la salida en $\\LaTeX$.\n",
"* __Ha creado una serie de variables__ para que podamos ponernos a trabajar en el momento."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Nota: \n",
"En Python, no se declaran las variables, sin embargo, no puedes usar una hasta que no le hayas asignado un valor. Si ahora intentamos crear una variable `a` que sea `a = 2 * b`, veamos qué ocurre:\n",
"
"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'b' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;31m# Intentamos usar un símbolo que no hemos creado\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0ma\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m2\u001b[0m \u001b[1;33m*\u001b[0m \u001b[0mb\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[1;31mNameError\u001b[0m: name 'b' is not defined"
]
}
],
"source": [
"# Intentamos usar un símbolo que no hemos creado\n",
"a = 2 * b"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Como en `b` no había sido creada, Python no sabe qué es `b`.\n",
"\n",
"Esto mismo nos ocurre con los símbolos de SymPy. __Antes de usar una variable, debo decir que es un símbolo y asignárselo:__"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAAsAAAAJBAMAAAAWSsseAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIquJdjLdEETvu2aZ\n",
"VM0GsGrEAAAAR0lEQVQIHWNgYFR2TWdgYOgU4PrAwMA+m4FnAQMDz3cGNgcGBs4FDPUBDAz1Bgz3\n",
"GQoY6i8wrOMVYOBz4E5iBqpUMRXyYAAAgLMMA5qDwz8AAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$a$$"
],
"text/plain": [
"a"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Creamos el símbolo a\n",
"a = symbols('a')\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAEcAAAAbBAMAAADc0o+gAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMmYiu80QdonvRN2Z\n",
"VKvu110NAAABaklEQVQoFY2SPUjDQBiG36R/aZv+LI5ixNWhiIuLlop7ljg5BJycUnERHUwp4iIO\n",
"jl0sbuJSKCgOSgZx7iB0krqIjp2chPjdXS40Npge5PvyPvf08iUUSFja80uCQdttfCRLfSzUEq0O\n",
"NrqJEjCyZ5DuZ3A0jyTFoBK/FhleZmWVlfhVrgIFt0B1O17g1ATm3l5t5NxJaXcyAIfAle8D+cin\n",
"GkalvSDeRvAfKTMQu+fUUl/7dyJJ6cT3/R+Avz7tNOi6qaXHEUlrDVcOaA7VFPgRyF5Cr0ekebRz\n",
"VSKlnsAdQP9GsRmRgHrZJqKMQylfh8N+d2pZD5a1w7jyXuQtkOhxjosRbAYhB9eNCgOFHoN8cGeA\n",
"rVKNJyk5dqVLQA5+AWSa6pPGnfCkY+RdIronMH3M7Gdr/UgkeVIDZZdIpkuFVlE8R4TwpCCuBV31\n",
"ghvericDcCbjpryZ7llTsn/+dOlwlJQh9am+FJBfKodIyMpEGZwAAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$\\left(a + \\pi\\right)^{2}$$"
],
"text/plain": [
" 2\n",
"(a + π) "
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Número pi\n",
"(a + pi) ** 2"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAADUAAAAQBAMAAABEqSrGAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIquJdjLdEETvu2aZ\n",
"VM0GsGrEAAAA20lEQVQYGWNgwAQyp5YCBbUwJRgY2BUY7BsYGLRR5AohPKYCBs4JKBJAzhWIAGcC\n",
"A9NXHHJ83+FyjMqu6RBVUH1ADtt3dhsHIN0pwPUBXa7fgJkDaCX7bAaeBehyWQyyPA8YGHi+M7A5\n",
"oMkBFRfwAwU5FzDUBwDl7N69y3z37g1YlROQvF/AwFBvwHCfAUgDAcwtvAcYBBkesQPlLjCs4xVA\n",
"kYthYHBk/8vMwMDnwJ0EpEAAqo8x2fhQAscHaaA7VUyFPFDk+P7//5/AsMQBIgglYfahCEI53WiC\n",
"ADOzNGKoH4+vAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$a + 2 i$$"
],
"text/plain": [
"a + 2⋅ⅈ"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Unidad imaginaria\n",
"a + 2 * I"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJBAMAAAASvxsjAAAALVBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAOrOgAAAADnRSTlMAEIl2mSJE3e9UMqtmzXCQ\n",
"kgMAAAA4SURBVAgdY2BgVDYJYGBID2BVYGDtZBBZwMDdY3yQgYFvAwMQ8CmASA4gacDAfIFBBKjS\n",
"xOYAAwDWpwf9jP6jxwAAAABJRU5ErkJggg==\n"
],
"text/latex": [
"$$e$$"
],
"text/plain": [
"ℯ"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Número e\n",
"E"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"sympy.core.symbol.Symbol"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Vemos qué tipo de variable es a\n",
"type(a)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Ahora ya podría crear `b = 2 * a`:"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAABQAAAAOBAMAAADd6iHDAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIpm7MhCriUTv3c12\n",
"VGZoascqAAAAgElEQVQIHWNgVDJ2YICAMAb2H1BmKgPDTChzFgNDvgOEvT8AzgQKrA9gEKvxCgCy\n",
"OL4zcExksAcp4jJgiHzAoAxiAgn9AIY1QBZPAgPDZAbWL0DmJQZG0e8MvB9YGVgUGHhE/zIwb7jI\n",
"IFVelMWwh+FVQgHD/v//fzGEHXfMaQAAed4eWkglV6IAAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$2 a$$"
],
"text/plain": [
"2⋅a"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"b = 2 * a\n",
"b"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"sympy.core.mul.Mul"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"type(b)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"¿Qué está ocurriendo? Python detecta que a es una variable de tipo `Symbol` y al multiplicarla por `2` devuelve una variable de Sympy.\n",
"\n",
"Como Python permite que el tipo de una variable cambie, __si ahora le asigno a `a` un valor float deja de ser un símbolo.__"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAEEAAAAPBAMAAABJi79qAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIpm7MhCriUTv3c12\n",
"VGZoascqAAABOklEQVQYGYWQPUvDUBSG32AvqUnFzE5SQRGXC110MpvrnQRxsCAWdGkogouQ/AEH\n",
"F0Glv0EncUsoLuKgiLtxcBCFIIKVdojn3BNn7/Ic3vfhfsFptkLQErqH+zTXZqEWBkGVrcP9YcNS\n",
"XWOJZk9jI3eOJcMOcMqGpR+hRfOtxi6wXXVnQDek1LIIaILzrjEGYiNdasSwXGEBrq/VF3Cf/HW4\n",
"MLYgjtcGCfDia5zTHjnFtqsPRagP1ThHHyojIwbSDJCObm6Xp1VpsGhckOFnU7yHdHMigDgCiuSJ\n",
"DXzcxA/gDGi0xWDS6cVrZA16oqm6RzgBO0x6S3HU6XRPMgquJOMfbrBh+Uz3oHlS4y2ofVbdzEFv\n",
"D1uXsJyIVJ+MaY07s5lLhrQsR/DaQvTmQ/qx1e/cbS7Te7n7f/0C3j1luetES28AAAAASUVORK5C\n",
"YII=\n"
],
"text/latex": [
"$$2.26492$$"
],
"text/plain": [
"2.26492"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a = 2.26492\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"float"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"type(a)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"__Las conclusiones son:__\n",
"\n",
"* __Si quiero usar una variable como símbolo debo crearla previamente.__\n",
"* Las operaciones con símbolos devuelven símbolos.\n",
"* Si una varibale que almacenaba un símbolo recibe otra asignación, cambia de tipo.\n",
"\n",
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__Las variables de tipo `Symbol` actúan como contenedores en los que no sabemos qué hay (un real, un complejo, una lista...)__. Hay que tener en cuenta que: __una cosa es el nombre de la variable y otra el símbolo con el que se representa__."
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAABUAAAAMBAMAAAB/4Ov2AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAiXYyIt1Uze+rmRC7\n",
"ZkTTotXTAAAAdklEQVQIHWNgYBBUMmCAAtcE9oIbs87Pmn+BgaGRgTNhNsN9Bt4HDFy/GRi4FRjW\n",
"MLA5MHAcYGBg3sAQyMDHwLBfAKSP+x+I5AdqSWDgA6pkYOCawLDLgIExAMRmELyrwMDAMwHMBhMg\n",
"lTBgbwBjMbyMnwhkAwDTKhfdwCmMrwAAAABJRU5ErkJggg==\n"
],
"text/latex": [
"$$c_{T}$$"
],
"text/plain": [
"c_T"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#creación de símbolos\n",
"coef_traccion = symbols('c_T')\n",
"coef_traccion"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Incluso puedo hacer cosas raras como:"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAAkAAAAOBAMAAAAPuiubAAAALVBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAOrOgAAAADnRSTlMAELvv3c2rVESJdpkiZvtO\n",
"0HUAAABRSURBVAgdY2BUdmAAAtYEEMlXACL7BEDkFBDBELZqOwMD41MBvgMM7A8Z+CYwcAcwyE1g\n",
"YN3A0FfAwHeBYZ8AA18Doy0DA9sFpg1AlbtyGRgAGgIPXyFTKDkAAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$b$$"
],
"text/plain": [
"b"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Diferencia entre variable y símbolo\n",
"a = symbols('b')\n",
"a"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Además, se pueden crear varos símbolos a la vez:"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"x, y, z, t = symbols('x y z t')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"y símbolos griegos:"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAEQAAAAaBAMAAAD8uecGAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMkS7zRCZdiKJ71Rm\n",
"q90icBAQAAABaElEQVQoFX2QvUvDUBTFT0LS5tUo4j/Q4C4WRHCs4OAiFHQSoRkU10wVOkhBF11a\n",
"HBzqYDcHl04uLp0cFCdxctFBBxdRWz+wUs8L9L2UxlxI8rvnHO67LwAmkFCB9IxcQgJT0rQKSRHR\n",
"orv5T+Jsq+TRegScTnxkdxb2Ag8oAcKPjzzTXs0DVSDTjI2ID8qpT2CshWz8tlaXEfedsRwuiTk+\n",
"+x5fulQk3cA6wx6tYqB9kvjmSx5kdjBDkqYY3MnhGbB4W+MVS8AkcA+3IoO6jrljlZOdNzwBAQwf\n",
"Qrsh8SbYJjk/coqPdBN7gxHbzAPzdjiFkTlkfSwORgRu4fgcbXzhBqgfnv7Wa7DbkdTo1QHMo4vw\n",
"RmVguT1ePqH9wg37JXpduD1e2m1gWutmpR+IfPl3M57qXUURsAKkaqpfUxSBYgFGQ/UtRRG4Jt9F\n",
"+hh8oLYSo2vJlXuM+FoYpp1QOh82tLKhMYH+AIxDSfatV65XAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$\\begin{pmatrix}\\omega, & \\Omega\\end{pmatrix}$$"
],
"text/plain": [
"(ω, Ω)"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"w = symbols('omega')\n",
"W = symbols('Omega')\n",
"w, W"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"![](../images/simplification_sympy.png)\n",
"_Fuente: Documentación oficial de SymPy_"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__Por defecto, SymPy entiende que los símbolos son números complejos__. Esto puede producir resultados inesperados ante determinadas operaciones como, por ejemplo, lo logaritmos. __Podemos indicar que la variable es real, entera... en el momento de la creación__:"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Creamos símbolos reales\n",
"x, y, z, t = symbols('x y z t', real=True)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"{'complex': True,\n",
" 'real': True,\n",
" 'hermitian': True,\n",
" 'imaginary': False,\n",
" 'commutative': True}"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Podemos ver las asunciones de un símbolo\n",
"x.assumptions0"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Expresiones"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Comencemos por crear una expresión como: $\\cos(x)^2+\\sin(x)^2$"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAJ4AAAAZBAMAAAAyHoooAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMnZUzRC73UTviSKZ\n",
"ZqszMyTAAAACR0lEQVQ4EY2UP2gUQRTGv83deps9FqOkTpazixAPhIg2Cbj+KZcgFhZiIYIE/xDL\n",
"NNeJNoliEVBwCwtJVK4KBhW30UIsDrESCwMKFlpEMMQYXeftzNvb2ezdOM375r3f993M7nJAfrmv\n",
"X+W3Jm3El/HZlJGfG/E5jLbzBoM24ot42TJk5Mf/gU+GeYNRG/HZNMLqyCRvyJBYjlu32ebGqVrh\n",
"/RqL8toDt7YY/yjFMd5XWZRXE+5EDt1wIGI7K7vNnXztiTM0fHAiFHowc9sLclTxGcnXXnh9j6Lu\n",
"Jwmp613TUSnL88pwa19jauUvhu/tHfc55pEQ0+NPx0SDpFicZ79ZauJM4yHIRgNaGn4auIrLwHG/\n",
"/luOgUuAHXmztSngvexx3mrTumvNYZef2hSv4TdCRJR3Efij5rgGuKH7syIe4yE9L0BlvRbBWk9t\n",
"itfw2sZ+UN554AfnLYrzoXqOtqOyp85nb1OrCWylNjmDhtsPkpjyLuh5wG6fcMpzg+DEnSCIAYd+\n",
"crIFbKQ2saEl8rr4M3ibxTxxAZE0hDB71cXzbac2wsTS8CPA92KeeMCV8AAGRF7hfQRiMhjD2Uxt\n",
"Mo5eXxc/HGKGLpu/7xNgvnkFLwT/VnrU+bDawbJ1C9Uotak8Db/57kNrJPkykqxN/PqkAPE9n21M\n",
"P+6I7UnZ4jz721gbz5e+gmyKps+/gPNE1VqbG/UFqTiP+1rdiWtjwIu54fpSOXTWXmsnXiRnuHGK\n",
"Rd9qxLP/04zsm2fE6+p6XvYg++bl8H+XJanULdBSMwAAAABJRU5ErkJggg==\n"
],
"text/latex": [
"$$\\sin^{2}{\\left (x \\right )} + \\cos^{2}{\\left (x \\right )}$$"
],
"text/plain": [
" 2 2 \n",
"sin (x) + cos (x)"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"expr = cos(x)**2 + sin(x)**2\n",
"expr"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### `simplify()`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Podemos pedirle que simplifique la expresión anterior:"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAAgAAAAPBAMAAAArJJMAAAAAJFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAADHJj5lAAAAC3RSTlMAzRAiu5mrdu/dZmiL4QAAAAAjSURBVAgd\n",
"Y2BgEGJgYDDZxMCgEgYkGNhJJVgzdmYB9TEwAACPpQrvlUCHcAAAAABJRU5ErkJggg==\n"
],
"text/latex": [
"$$1$$"
],
"text/plain": [
"1"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"simplify(expr)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"En este caso parece estar claro lo que quiere decir más simple, pero como en cualquier _CAS_ el comando `simplify` puede no devolvernos la expresión que nosotros queremos. Cuando esto ocurra necesitaremos usar otras instrucciones."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### `.subs()`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"En algunas ocasiones necesitaremos sustituir una variable por otra, por otra expresión o por un valor."
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAJ4AAAAZBAMAAAAyHoooAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMnZUzRC73UTviSKZ\n",
"ZqszMyTAAAACR0lEQVQ4EY2UP2gUQRTGv83deps9FqOkTpazixAPhIg2Cbj+KZcgFhZiIYIE/xDL\n",
"NNeJNoliEVBwCwtJVK4KBhW30UIsDrESCwMKFlpEMMQYXeftzNvb2ezdOM375r3f993M7nJAfrmv\n",
"X+W3Jm3El/HZlJGfG/E5jLbzBoM24ot42TJk5Mf/gU+GeYNRG/HZNMLqyCRvyJBYjlu32ebGqVrh\n",
"/RqL8toDt7YY/yjFMd5XWZRXE+5EDt1wIGI7K7vNnXztiTM0fHAiFHowc9sLclTxGcnXXnh9j6Lu\n",
"Jwmp613TUSnL88pwa19jauUvhu/tHfc55pEQ0+NPx0SDpFicZ79ZauJM4yHIRgNaGn4auIrLwHG/\n",
"/luOgUuAHXmztSngvexx3mrTumvNYZef2hSv4TdCRJR3Efij5rgGuKH7syIe4yE9L0BlvRbBWk9t\n",
"itfw2sZ+UN554AfnLYrzoXqOtqOyp85nb1OrCWylNjmDhtsPkpjyLuh5wG6fcMpzg+DEnSCIAYd+\n",
"crIFbKQ2saEl8rr4M3ibxTxxAZE0hDB71cXzbac2wsTS8CPA92KeeMCV8AAGRF7hfQRiMhjD2Uxt\n",
"Mo5eXxc/HGKGLpu/7xNgvnkFLwT/VnrU+bDawbJ1C9Uotak8Db/57kNrJPkykqxN/PqkAPE9n21M\n",
"P+6I7UnZ4jz721gbz5e+gmyKps+/gPNE1VqbG/UFqTiP+1rdiWtjwIu54fpSOXTWXmsnXiRnuHGK\n",
"Rd9qxLP/04zsm2fE6+p6XvYg++bl8H+XJanULdBSMwAAAABJRU5ErkJggg==\n"
],
"text/latex": [
"$$\\sin^{2}{\\left (x \\right )} + \\cos^{2}{\\left (x \\right )}$$"
],
"text/plain": [
" 2 2 \n",
"sin (x) + cos (x)"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"expr"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAALUAAAAcBAMAAADVbuO8AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMnZUzRC73UTviSKZ\n",
"ZqszMyTAAAADXUlEQVRIDZV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rmcy3HNFHg4VRpbe7+02t6MlBq3T\n",
"btCH5KzmNBd9hNX9StMCHRq1zLEEbva41Oaik9UuS9VFc2wmq9eai/yFCi+cruCW6HDVaitRb4UX\n",
"cSq4JfInKsv/LKpI/gv9Bazq4ZC5YrNKAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$\\sin^{2}{\\left (y^{2} \\right )} + \\cos^{2}{\\left (y^{2} \\right )}$$"
],
"text/plain": [
" 2⎛ 2⎞ 2⎛ 2⎞\n",
"sin ⎝y ⎠ + cos ⎝y ⎠"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Sustituimos x por y ** 2\n",
"expr.subs(x, y**2)"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAJ4AAAAZBAMAAAAyHoooAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMnZUzRC73UTviSKZ\n",
"ZqszMyTAAAACR0lEQVQ4EY2UP2gUQRTGv83deps9FqOkTpazixAPhIg2Cbj+KZcgFhZiIYIE/xDL\n",
"NNeJNoliEVBwCwtJVK4KBhW30UIsDrESCwMKFlpEMMQYXeftzNvb2ezdOM375r3f993M7nJAfrmv\n",
"X+W3Jm3El/HZlJGfG/E5jLbzBoM24ot42TJk5Mf/gU+GeYNRG/HZNMLqyCRvyJBYjlu32ebGqVrh\n",
"/RqL8toDt7YY/yjFMd5XWZRXE+5EDt1wIGI7K7vNnXztiTM0fHAiFHowc9sLclTxGcnXXnh9j6Lu\n",
"Jwmp613TUSnL88pwa19jauUvhu/tHfc55pEQ0+NPx0SDpFicZ79ZauJM4yHIRgNaGn4auIrLwHG/\n",
"/luOgUuAHXmztSngvexx3mrTumvNYZef2hSv4TdCRJR3Efij5rgGuKH7syIe4yE9L0BlvRbBWk9t\n",
"itfw2sZ+UN554AfnLYrzoXqOtqOyp85nb1OrCWylNjmDhtsPkpjyLuh5wG6fcMpzg+DEnSCIAYd+\n",
"crIFbKQ2saEl8rr4M3ibxTxxAZE0hDB71cXzbac2wsTS8CPA92KeeMCV8AAGRF7hfQRiMhjD2Uxt\n",
"Mo5eXxc/HGKGLpu/7xNgvnkFLwT/VnrU+bDawbJ1C9Uotak8Db/57kNrJPkykqxN/PqkAPE9n21M\n",
"P+6I7UnZ4jz721gbz5e+gmyKps+/gPNE1VqbG/UFqTiP+1rdiWtjwIu54fpSOXTWXmsnXiRnuHGK\n",
"Rd9qxLP/04zsm2fE6+p6XvYg++bl8H+XJanULdBSMwAAAABJRU5ErkJggg==\n"
],
"text/latex": [
"$$\\sin^{2}{\\left (x \\right )} + \\cos^{2}{\\left (x \\right )}$$"
],
"text/plain": [
" 2 2 \n",
"sin (x) + cos (x)"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# ¡Pero la expresión no cambia!\n",
"expr"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAALUAAAAcBAMAAADVbuO8AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMnZUzRC73UTviSKZ\n",
"ZqszMyTAAAADXUlEQVRIDZVVS2gTURQ9k3SaydcqRXTTDHWlFg0UChWhQaPuyizERRcaRAVRirit\n",
"QnRnN41VoaBgEBfSVggIQlFoLDWLbizuLC4ifhBRaIWW2lbjfe/dN8nkh17I3HPvO+fMzePNDOCJ\n",
"6cuOpw4VX3vqRkUdp9ZEiUL5WNIjn8InT92oqOXUmShRIG9sKrRLpRHE875GhlU9wZGlkZFJmtSL\n",
"gpnwuqKlZcIEZjNWSeFmV8GRazsVQ5o0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 2⎞ 2⎛ 2⎞\n",
"sin ⎝y ⎠ + cos ⎝y ⎠"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Para que cambie\n",
"expr = expr.subs(x, y**2)\n",
"expr"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Cambia el `sin(x)` por `exp(x)`"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAALUAAAAcBAMAAADVbuO8AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMnZUzRC73UTviSKZ\n",
"ZqszMyTAAAADXUlEQVRIDZVVS2gTURQ9k3SaydcqRXTTDHWlFg0UChWhQaPuyizERRcaRAVRirit\n",
"QnRnN41VoaBgEBfSVggIQlFoLDWLbizuLC4ifhBRaIWW2lbjfe/dN8nkh17I3HPvO+fMzePNDOCJ\n",
"6cuOpw4VX3vqRkUdp9ZEiUL5WNIjn8InT92oqOXUmShRIG9sKrRLpRHE875GhlU9wZGlkZFJmtSL\n",
"gpnwuqKlZcIEZjNWSeFmV8GRazsVQ5o0EvlXJaHN3fYBB0+VpvmVOCKOaYYwaSAK2JIwp2m4CgTc\n",
"G7ldLyAORcSWiS7CRIuMcd3FtERhNT3hUAHw0a9VCA7FrDuCMNEiY0Mu0iVakIjZhN/TL7wsm00v\n",
"gkMhHGVIk3rRKG6I5WBCsWDlrA7gOldmnoEnKQ5wR3eViRbprnG097zAcYc7nb19BItc+W0GnqQ4\n",
"MPQ+sgmLwtuZHCyXlwV8p8UPy2WCe7ls7K04iGaZxSYkMvZ0J5//QeeDHQdsXgTmAXPaxgyPP8ZZ\n",
"e5sLkwkMdT+RYi2KJIGhOYTvcYNEp4ArGAaO22F+JGntAh0QfxYHmRbvUEB7zySM+8YI2m0pZlJ7\n",
"Gsj1w7dcEd1ykBPeF4Hf3AUGgWc0B91CBj930N4p+FcCORgrUsykthLCiXmIW8ggUWBtP4T3OeAn\n",
"d4FrgBO03cZsQq2wt7lFZZx6G1LMqkABJsaxzeaaRObjckF404wV70FaH3OMFU3LEAilUifuplIF\n",
"wBLEAeqtSTEVImhuWKvQ+ydeMi8QXW/oPQ9fVopoxrwCtXNvSTGThHck6Z4pIToE/Kjz/kL8YbQT\n",
"W0btOUkB/mAB1roUMymWhlDQFqggUb+DS2JDPHsiDnQRY4tM08ed58bMIqaM22jLSTGTxL+MpC33\n",
"QJBo9O1Spqv8uav8oe9XiWm018DpR294K+qeS/P7vjxeTn6VYq2hvYb5rWdT10UNanIwIxr0BKk4\n",
"wlnPrfvePCFK2nEOLdK1zpEcYklTfYJoGv2msPQmaZ4nL4A+rmcy3HNFHg4VRpbe7+02t6MlBq3T\n",
"btCH5KzmNBd9hNX9StMCHRq1zLEEbva41Oaik9UuS9VFc2wmq9eai/yFCi+cruCW6HDVaitRb4UX\n",
"cSq4JfInKsv/LKpI/gv9Bazq4ZC5YrNKAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$\\sin^{2}{\\left (y^{2} \\right )} + \\cos^{2}{\\left (y^{2} \\right )}$$"
],
"text/plain": [
" 2⎛ 2⎞ 2⎛ 2⎞\n",
"sin ⎝y ⎠ + cos ⎝y ⎠"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"expr.subs(sin(x), exp(x))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Particulariza la expresión $sin(x) + 3 x $ en $x = \\pi$"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAABYAAAAOBAMAAADZH/H+AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIom7VJlmdt1E7xDN\n",
"MqsI8sYEAAAAjElEQVQIHWNgEFIyYYACxgAG/wQom/0LA38DlM25kmH/ASgbSMHVANlHGRjq////\n",
"/5WBgVcjgIFJ112sUACkUuvCFQZF9gsgJgPXagYGA74NDAyMAgzMXxh4H3AABfl/MzB/Y2BN4AeK\n",
"cxkwcHxk2L+BfwIDA1sCg38BQwUDlwJQ0dRQSwYGMwY+BQYAbFgct5yPkD8AAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$3 \\pi$$"
],
"text/plain": [
"3⋅π"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"(sin(x) + 3 * x).subs(x, pi)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__Aunque si lo que queremos es obtener el valor numérico lo mejor es `.evalf()`__"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAP4AAAAPBAMAAAA2dm/eAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEJmJdiLvZqu7zURU\n",
"Mt3PQnSBAAADvUlEQVQ4EcWVz2scZRjHvzOz2Zn9lR1UAvbQXVuUVCkO2aD2ULPUCFIQB8WKXro9\n",
"BKkNuGAo3rKU0lRQ3CIIosLWFmpQ6SCevHTBg96ytHez0EsDHrraNm1Su36f55nN5j9wYJ955vl8\n",
"n+d533nfeRd4bPZp2HUdePPAt+LT+/NMrRaNTSqrvdKjdzDF8GYPw8hbtW9QurW/VoOz/0hs2cBF\n",
"1rocXk8gGM78TGJENWnwfRyLrf8GnBbmEj5sAMvD4bA1No7K9iRuBz9ib2zY+QHPQslEFWtNnyn3\n",
"MdWcWDCMdwes9eHwDhTDBT41ohoLBg0Ebe2fOYkgRLYB0ANfSrDLmOwScm2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.424777960769379715387930"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"(sin(x) + 3 * x).subs(x, pi).evalf(25)"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAQgAAAAPBAMAAADqqkzAAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIom7VJlmdt1E7xDN\n",
"MqsI8sYEAAAEFklEQVQ4EcWV32scVRTHvzO7O5vs7G5GoSIiGLakEcFmtQpqH7II+mjWlDxEbTMI\n",
"ttAHsxZCH6w0UHyTZF5EEMGEiNgf0kGQSi1mqdgiQbME+lbsgjYVfzStjWmbXTp+zzm7of+BAztz\n",
"9nvP93PO3nvnLvBg6RnolY/lcYkfiS7GlyL4o1MBnLFdDYqlQw0T1ZB/tzAO//BAJ6cwM1oq4evB\n",
"VwGntL1iHo1w5tB4lysIo7mDT3ZEpTlVjIQiOMPaxLFOdDq5DZwNnXl8B/cucC7K1CGiGXJJUkMG\n",
"+M1yvCRJ7vmf45EA25DeMI9GqKJYIZ5cRSjN/xFvSM1jHVp2HX3T/O4/uyZNZBc60flrAfAH8Cv+\n",
"BE4A55EqQ0Qz5He+A7wMPGo5GSY3i3MolnG0gjvm0Sgdwqkr1xBKy/djlxUzWu9xLDKJ11Fp4qHv\n",
"O1GTT7SBofgLYK3h3ZTvTX7MUJSv24FvLMcF3EZfHW4LH0d+G+rRyC3Dn1auIXRkkj3zYrGt8rYc\n",
"1kT//U34t9hatByzidScuJpyg6yfNvHpbuywHIofYbGMLBdOlkM9GvXeit0QINcQOvICs3hpsc5u\n",
"+MEkmQkv6DaxemAvcIozEXJ0Nu77aZD7S0WAhuL+qQaKyZvhVk4ZOc7EBrPzVQHOEifR2sYO4xpC\n",
"R9orU1G3mNBQeFw9thxn0G1iNx6LMAQs17gC/2DxAnIVqKiGVOzwR0+0424Of657A3nu5pX3pQd6\n",
"LMokS4BwDSEjfjvEZyZulX+iIS5djv6tJoDUNPK1tMxETxmLLWROMokiYIbn4O1dPt7NWaR+ES/K\n",
"TLhf8kaPRW9d3owg3C6ip+wnMV6LVWSS0XJC1ybSjfuayHAvHnhvqALsgbxBnqy3iDDDRPA2vM24\n",
"k3OEund4ZZ0PnIjVo5HXxORJ5XYRpN0BJqNOMaE5AVLqlJn4Ct0milxfKYq1GNkm69bhbahohr+4\n",
"WyI2f6UCzZFzgFexhQeA4QqyTViUi1FYV64i+LJy5BSbCFU0Wl8LKZlDnYlXrl/fvKYRHZmWqD8D\n",
"L7FTbm3vropmIGbi2xusGlqOf0+SkW+CUz0cqkcjWaZV5SrCaHw7JiMVjZYro0fPAHtFsUAT5yTD\n",
"Va3jYFC4iUIV2SDNPTGnohmqwAeY5x4JNAeFf7ka87gSCGA2UI9GuQB4iswFKMJoI9wT1CgazQsx\n",
"UuPxoqV559EgTfBwPhjgSHwuxMOlgd+Bp3G2oqIaeDiz5CfcEJaDNJvILvkXgP1I3zaPRr1L8GrG\n",
"FYSNpPp9vh1SzGj4cOx5YAbYd3om5CGYrFq0befr3N0ytpwk3Eju2N+AimpwRq9ysa/yD0xz4Ah0\n",
"YE/EN3CMd/VohF9GxzkkXEUYbWBfoyMqjfH/fv0H1DXIUHmhQVgAAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$3.141592653589793238462643$$"
],
"text/plain": [
"3.141592653589793238462643"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#ver pi con 25 decimales\n",
"pi.evalf(25)"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAQgAAAAPBAMAAADqqkzAAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAA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BJqNOMaE5AVLqlJn4Ct0milxfKYq1GNkm69bhbahohr+4\n",
"WyI2f6UCzZFzgFexhQeA4QqyTViUi1FYV64i+LJy5BSbCFU0Wl8LKZlDnYlXrl/fvKYRHZmWqD8D\n",
"L7FTbm3vropmIGbi2xusGlqOf0+SkW+CUz0cqkcjWaZV5SrCaHw7JiMVjZYro0fPAHtFsUAT5yTD\n",
"Va3jYFC4iUIV2SDNPTGnohmqwAeY5x4JNAeFf7ka87gSCGA2UI9GuQB4iswFKMJoI9wT1CgazQsx\n",
"UuPxoqV559EgTfBwPhjgSHwuxMOlgd+Bp3G2oqIaeDiz5CfcEJaDNJvILvkXgP1I3zaPRr1L8GrG\n",
"FYSNpPp9vh1SzGj4cOx5YAbYd3om5CGYrFq0befr3N0ytpwk3Eju2N+AimpwRq9ysa/yD0xz4Ah0\n",
"YE/EN3CMd/VohF9GxzkkXEUYbWBfoyMqjfH/fv0H1DXIUHmhQVgAAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$3.141592653589793238462643$$"
],
"text/plain": [
"3.141592653589793238462643"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#el mismo resultado se obtiene ocn la función N()\n",
"N(pi,25)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Simplificación"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"SymPy ofrece numerosas funciones para __simplificar y manipular expresiones__. Entre otras, destacan:\n",
"\n",
"* `expand()`\n",
"* `factor()`\n",
"* `collect()`\n",
"* `apart()`\n",
"* `cancel()`\n",
"\n",
"Puedes consultar en la documentación de SymPy lo que hace cada una y algunos ejemplos. __Existen también funciones específicas de simplificación para funciones trigonométricas, potencias y logaritmos.__ Abre [esta documentación](http://docs.sympy.org/latest/tutorial/simplification.html) si lo necesitas."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### ¡Te toca!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Pasaremos rápidamente por esta parte, para hacer cosas \"más interesantes\". Te proponemos algunos ejemplos para que te familiarices con el manejor de expresiones:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__Crea las expresiones de la izquierda y averigua qué función te hace obtener la de la derecha:__\n",
"\n",
"expresión 1| expresión 2\n",
":------:|:------:\n",
"$\\left(x^{3} + 3 y + 2\\right)^{2}$ | $x^{6} + 6 x^{3} y + 4 x^{3} + 9 y^{2} + 12 y + 4$\n",
"$\\frac{\\left(3 x^{2} - 2 x + 1\\right)}{\\left(x - 1\\right)^{2}} $ | $3 + \\frac{4}{x - 1} + \\frac{2}{\\left(x - 1\\right)^{2}}$\n",
"$x^{3} + 9 x^{2} + 27 x + 27$ | $\\left(x + 3\\right)^{3}$\n",
"$\\sin(x+2y)$ | $\\left(2 \\cos^{2}{\\left (y \\right )} - 1\\right) \\sin{\\left (x \\right )} + 2 \\sin{\\left (y \\right )} \\cos{\\left (x \\right )} \\cos{\\left (y \\right )}$\n"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAH8AAAAgBAMAAADJS7oCAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMkS7zRCZdiKJ71Rm\n",
"q90icBAQAAACjklEQVRIDaVVS2gTURQ9M81npglxEDeukp0gSgtduJJ0MdiV9i2UaKE0kNpus4oo\n",
"SAcFcSE2YLEWLMQfQhcaEBTswlm5EIWCuhBBcaERN1axqCjGO/PefTNtA03JW8w999xzz/vMywTo\n",
"YdiVkz10U+s1vOrN4DPyXk8ONzFbiBnML4pY1h18EmtJ+anB7rpiqlaAd0oiVc+uxkpbwGpYt8sU\n",
"DD1vajhku3rsD1VPg2dCcMeYw2jraPukMesmtUyzujTCqJv4kUS7lh8IWGtavvEQrYUrTV2MgDU1\n",
"RPPWiLjfbgPhOciq8SdSBegCMn/XM2E2Dvs7MMuVfp5kzLGUPOnJ4kwT/1gWxOMyeQ0sATlfZsgL\n",
"BXJe9o6EmaqMewvJH6oYhkcyuQe8d6D3+4wlxvyiJzEbYMMWlMGoCAzSDdU4SbF09txpNWvARgaJ\n",
"Mk5Mw1IrUwak+Cpg8uEPAcl6tpUbDlrl0Aa7PwH1x0ivSl4bmL/p/n1T6sP0IoS9lvFUTkEbwL5h\n",
"NSfRNyhr2iBHhEVvIhw0SRIJJZFUZIClY7iLHVXJa4MK5Ra/c1oBtISg7bpHbrtumeBFoNikveYd\n",
"SuZc94vrHiKE9Ao99ApCA5KIoCQHr6AtUPTpF3ZG8byCh7A8GL8U+5L2LGaQ7mBwi47b61vBwfUG\n",
"RhlpL3oLZD/QLOKSEgWBV/AcmZ90YUy+z2oFlxeuvgOyDdUxIDB+qnTdV2kQ2MCcqhSQfFPjxSqD\n",
"0Xabbri+if2FWKuEbKAK+jvDZxDyiSqX6wpEwfQjTF/+iYJK98VoTPChGY04vRm3cGAzScwLzb7V\n",
"qCPYU3M68h80e1Sj7YBstPNMeTuNrD3PgOJyDHcNe/xbjs3zH6QwjEMZRL6yAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$\\left(x^{3} + 3 y + 2\\right)^{2}$$"
],
"text/plain": [
" 2\n",
"⎛ 3 ⎞ \n",
"⎝x + 3⋅y + 2⎠ "
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#1\n",
"expr1 = (x ** 3 + 3 * y + 2) ** 2\n",
"expr1"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAScAAAAYBAMAAABKLya+AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEHarIkSJZt3NV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2Z5HbJdQVfaZwKbeNQxTlKibmEqH0otKRCtl47Eb4whJ7JDP/U/gJeEoI\n",
"+FmYolhYWcVx6mZGphN1daf4eGK70CTYw4KdsUJ/8R2pkI1zn6jPoN8N2SOZCVX44NTWshDIosD+\n",
"qX2v226JUFjcWlPPHZp+mzJhf+OPKk0jv7f65xmhMJS/vsVeTdeOPAm2dff9ZmkwGCwLgSwq4wy1\n",
"pKUY+T0u8gsWTTmU3WCPWQ4xs8eC1KIojuYM3fmW4ncbh8L0wKt0M6PwmLVkw4LUoqJmYjoeTASJ\n",
"jf+wyPRkCjKaFKd+y1CM4kyPS/AvKPASdkUmGx8AAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$x^{6} + 6 x^{3} y + 4 x^{3} + 9 y^{2} + 12 y + 4$$"
],
"text/plain": [
" 6 3 3 2 \n",
"x + 6⋅x ⋅y + 4⋅x + 9⋅y + 12⋅y + 4"
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"expr1_exp = expr1.expand()\n",
"expr1_exp"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAANMAAAAzBAMAAAD/bSBoAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAzRAiu5mrdu/dZjKJ\n",
"RFRer8KoAAADkUlEQVRYCe1WS2gTURS9M2ObfzTiZyGWVwS7cRHQbgQxqN3oIlHSuq0ouBC0VGhd\n",
"FJqFC0FKK36qIhoXghYXdeFOSfxUoRSanV9oUEHcxBgXRYvG95kJbyZ3JpOJ7apv8ebec899582b\n",
"m3cDUDcUUgctE6AlV0pK7TmzUlIAo6tSrRXM6gG2dn4uKzCcPtKiDk23/VZP5bVfwDHZbWD78Lid\n",
"VCgh8y9DLi77znakH43bSSlEpo/B3oLs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kJggg==\n"
],
"text/latex": [
"$$\\frac{1}{\\left(x - 1\\right)^{2}} \\left(3 x^{2} - 2 x + 1\\right)$$"
],
"text/plain": [
" 2 \n",
"3⋅x - 2⋅x + 1\n",
"──────────────\n",
" 2 \n",
" (x - 1) "
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#2\n",
"expr2 = (3 * x ** 2 - 2 * x + 1) / (x - 1) ** 2\n",
"expr2"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAL4AAAAzBAMAAADbdK+oAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIom7VJlmdt1E7xDN\n",
"MqsI8sYEAAAC2ElEQVRYCbWWy2sTcRDHZzfp7uaxTbAg6ikUoiIiFR8gHtqD4kkakF5le1cIvQge\n",
"NAeh4sUiKF7Eq1WQFQ8FkboHPRlp/gM9iSi0VYpUAsbfZp+/zcwyP2n2kMzjO5+dndndBCD/sFv5\n",
"+VRWWzjVS7k805rh6YRqHfQ/bHEkvMnn/wB4HpVxv7VrfP4zgC3VAelVPn/DVecvKvDFTO673MEE\n",
"ukpbiV/6pYYHHZT4Cjdb0MhlNf4VxfYrDSW++UWRX9zc3HrZZhddBK3OFofCMv/+FK8SU5lf4/MP\n",
"TDe/qbavz/51uDUbg8Euot03fRqJ7llIa8G8s2e0UZC5A7VOEH41msUiTFlYWlqFd15gX8JoozGm\n",
"LCmM5sMsZMoS/ofQZBYyZRHfPtoaKx/gWC84AbMxpizqH6D8QuYPiCNzmYRKDvuvpMKOqDze7d7r\n",
"dqNVJCfPWExZUlXrQ+F34DIvnCkDaJ5xxXBmwPo5Fr5en/QADAfm22PhW3Xbb/zhwrkAD8wLZ8qg\n",
"vKLJ/+dyCz+GTQC3DaEv9uMi33gkebIzlUjzZHKRFQ5ejmLe66sJH8vjsSYexqImxrcdTOrHrvsf\n",
"Rsv/5B0ofwqvFaua7InUA3iCC9ZuHVzKjA7lJztPc4ar8gDs9xfOp+OxXWkYy5YQpA+MbzbSisgO\n",
"VrUkntzBYDsKSt+6q/eLdSkEGL+c0YQVQ+kbuVzyKtG/wrd3/eOTn8T4j6Wq2BlKq3Oxjxi1zPRx\n",
"vn/7UavSWwg2Dn3ugRs7QwPr/ywAuSrDk+vTXtG9DSaDfweAXFWxkybK9tO5Wdgvh9D5r4r+qVXZ\n",
"2xlAyl2/sXbYSfnCnPi++1WOCE/wAYhV5fFHQERAzAeAWFWpQxQphMV+yVUZngKIkJ4AIFc1kXt/\n",
"EsBMWDxf5KqqKxnxf7hWnS46RKfYmbz3+xE2JUd4ksxVPDKlkCB+XwShkDM6/gk0h9IuRol/D7fg\n",
"fgt6lZgAAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$3 + \\frac{4}{x - 1} + \\frac{2}{\\left(x - 1\\right)^{2}}$$"
],
"text/plain": [
" 4 2 \n",
"3 + ───── + ────────\n",
" x - 1 2\n",
" (x - 1) "
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"expr2.apart()"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAALYAAAAWBAMAAACfwnvZAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEHarIkSJZt3NVLsy\n",
"me8Q6PJIAAACVElEQVQ4EY2TP2gTURzHv3eX3CXpJT2iuNmmEbpapYOLeIvoVIqDLoIxhRTBYDfd\n",
"BDcXjV3qKdIq4iCIcRbxJnFLBrciKAjqItdijQThfJffu78vL+QN7/fe7/P9fe/37t0BNJprFl+J\n",
"of1OzkS1kClvlLtCkid0W+vI2DT5csPwZLqCbf6WsenyZWlvldXcwXQeMtWcKyNAaU/OpiDVzQmi\n",
"Qm0CnAJl7/Jo81NU1Y5WtMh9fuvi4+lWq5EBwXYMNIcpnfIdKzbPGP0UAg5BP8Bt3/eXMiDYCnDO\n",
"zQ1Id5iC9gVal5a4iMu0UmyKJ4BfYMfSuGAUpLBgG19J+IzCbAc6v0Hz0cs3lCzVKP4AzrgN4Dpt\n",
"aZZCs7lmk4R7z3eh8i+v4vteunzbYt5AvkZpOaweO7uYEHHvCut7gAwLW2Nm9y1gBlDqyxeaae8Y\n",
"QmkYdwodwsHMvXUPxf0si73zf5h0HTiCW7W7VCxC6Ja+V7IJBzP3xiZeDLIsLi+we1bYm7qKG9Zz\n",
"KhYhFBSZLh6ht1H/MMyyuHyXFajstBYeh6UiZGS2FmJcc5x7jvOE9hr7ThJMd5yHPx2nH0B1iU1B\n",
"78B+MEEC0XPZ46MR9g0UmUGaRa29Qs7GfPAA8x87+WiMgSXrOFTR2/iGnp1lYbnZh2qj1weeqh4W\n",
"0t4xxJWd9zhHdDTzvtUHypbAQu/zrfYp4HUf+eGMl9tIe0eQ/f716jqnSW+0d1cFFnpv+/5fYGUH\n",
"ysmFxZu8MQHyfCLE7zuRzJSLhGVC77GQkpcmsHzygFmdCP8DRkGoVzM4VAEAAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$x^{3} + 9 x^{2} + 27 x + 27$$"
],
"text/plain": [
" 3 2 \n",
"x + 9⋅x + 27⋅x + 27"
]
},
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#3\n",
"expr3 = x ** 3 + 9 * x ** 2 + 27 * x + 27\n",
"expr3"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAEYAAAAbBAMAAAAzEOSeAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMmYiu80QdonvRN2Z\n",
"VKvu110NAAABbElEQVQoFYWSv0rDUBTGv6SmrU2jHd2M+gJBXRSHog/QLtHF4YJD6SLd7GSDKHWQ\n",
"gCCCTsVNHHQTQbGDo0M2X6MI6iCiJ/efRiv3wM2533d+3HNyE8AQ3ZgZCJT9ctXIRPbAxADluplp\n",
"VoxMY82IUK8qYPn4J6a4b30A88OI3P5ugjGapFnJPQOrw5gleFSiN3ID+xiFKMNsCNVJ8A60aZJu\n",
"HGA0yDBPQp338i/USJYuMggkA97LSUTxgFJje7HdElIzTh8o0kpjGchH9rVL86WhmIlbErY07whn\n",
"xVcv4IhmUDykflfCPKVz4FSF+D4HOGGwBpoBxltc7IXhTRiu034OqCWaoV7AZAUszfqcT4aaj5Ls\n",
"RTN7rIMC44ia5wi4D/TMMXCZ1DArEMVMw3ujT94XLt3h5lZjx88ypceHHuDQSsMNRJZPdT9cLkjT\n",
"7suNSGc/VVeJFbX5k/N1ZQ39x3hxRI+R8xX9O89I4wvTnkk/yb5kGAAAAABJRU5ErkJggg==\n"
],
"text/latex": [
"$$\\left(x + 3\\right)^{3}$$"
],
"text/plain": [
" 3\n",
"(x + 3) "
]
},
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"expr3.factor()"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAGUAAAAVBAMAAACtcD09AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMnZUzRC73UTviSKZ\n",
"ZqszMyTAAAAB6klEQVQ4Ea1TTUgbQRT+1uxufjaGKj3WsKTkkkAUwUL1sofgycOcClWQCCIUQfYg\n",
"QttL6K2CJPTaHiSkl1KwUBBECylIjla9CP7AKniSQqooaqnbN7uT3Q0JnpzDvO+97/vmzT5mgYdY\n",
"ffcfsiNo6YOv0wo+9tFGfUokiUcukG59VmY+9pBiYaUoMsOreiDjIQ4m3CzBEC0LolXgFD8Kyg2D\n",
"boiaSPwRxEs3aj0iByKmBzkQHvnS98gDkJ6mjNU7PP7Um9NJFKsBSursXYUwLeEhFL5UvupYY1zx\n",
"AjAxB4zq2l+i1G1gHHv6PHcEPaXlWKiMfqDbwHuGZe55BfwjUXgA+IwVNuJYAn0W8D1uYAYImQhf\n",
"ZcE908A56aJFgGHUdQT6xAtgUZ1LpAaUql3jHjqh6XERUM3nX+fzY44/R3uJSTQ88qyj+zrg4XcD\n",
"UYrbqTmDUI2Em+gqO5MdBn4HPHwGQ10NpFs9T4AsqVTLmcFzhll+MXG3mIXIhdrQyMqX6KO9+bJl\n",
"oo4SleM1LO7uF5P2adI+fnZjOZ2Vk3TmyHF4Htm2bROTlV/fALkoOD+89SGh5veI4ibFtRaBkxy2\n",
"lJYCWcJQrikVLyRAQKX2nVdYV3V6WEY72/mf47pI6iftHc/80X5OsHIA/AfXZHJH94LmYAAAAABJ\n",
"RU5ErkJggg==\n"
],
"text/latex": [
"$$\\sin{\\left (x + 2 y \\right )}$$"
],
"text/plain": [
"sin(x + 2⋅y)"
]
},
"execution_count": 38,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#4\n",
"expr4 = sin(x + 2 * y)\n",
"expr4"
]
},
{
"cell_type": "code",
"execution_count": 39,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAGUAAAAVBAMAAACtcD09AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMnZUzRC73UTviSKZ\n",
"ZqszMyTAAAAB6klEQVQ4Ea1TTUgbQRT+1uxufjaGKj3WsKTkkkAUwUL1sofgycOcClWQCCIUQfYg\n",
"QttL6K2CJPTaHiSkl1KwUBBECylIjla9CP7AKniSQqooaqnbN7uT3Q0JnpzDvO+97/vmzT5mgYdY\n",
"ffcfsiNo6YOv0wo+9tFGfUokiUcukG59VmY+9pBiYaUoMsOreiDjIQ4m3CzBEC0LolXgFD8Kyg2D\n",
"boiaSPwRxEs3aj0iByKmBzkQHvnS98gDkJ6mjNU7PP7Um9NJFKsBSursXYUwLeEhFL5UvupYY1zx\n",
"AjAxB4zq2l+i1G1gHHv6PHcEPaXlWKiMfqDbwHuGZe55BfwjUXgA+IwVNuJYAn0W8D1uYAYImQhf\n",
"ZcE908A56aJFgGHUdQT6xAtgUZ1LpAaUql3jHjqh6XERUM3nX+fzY44/R3uJSTQ88qyj+zrg4XcD\n",
"UYrbqTmDUI2Em+gqO5MdBn4HPHwGQ10NpFs9T4AsqVTLmcFzhll+MXG3mIXIhdrQyMqX6KO9+bJl\n",
"oo4SleM1LO7uF5P2adI+fnZjOZ2Vk3TmyHF4Htm2bROTlV/fALkoOD+89SGh5veI4ibFtRaBkxy2\n",
"lJYCWcJQrikVLyRAQKX2nVdYV3V6WEY72/mf47pI6iftHc/80X5OsHIA/AfXZHJH94LmYAAAAABJ\n",
"RU5ErkJggg==\n"
],
"text/latex": [
"$$\\sin{\\left (x + 2 y \\right )}$$"
],
"text/plain": [
"sin(x + 2⋅y)"
]
},
"execution_count": 39,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"expand(expr4)"
]
},
{
"cell_type": "code",
"execution_count": 40,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAZsAAAAcBAMAAABFdA8fAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMkS7zRCZdiKJ71Rm\n",
"q90icBAQAAAF1ElEQVRYCe1Xe4hU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==\n"
],
"text/latex": [
"$$\\left(2 \\cos^{2}{\\left (y \\right )} - 1\\right) \\sin{\\left (x \\right )} + 2 \\sin{\\left (y \\right )} \\cos{\\left (x \\right )} \\cos{\\left (y \\right )}$$"
],
"text/plain": [
"⎛ 2 ⎞ \n",
"⎝2⋅cos (y) - 1⎠⋅sin(x) + 2⋅sin(y)⋅cos(x)⋅cos(y)"
]
},
"execution_count": 40,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"expand_trig(expr4)"
]
},
{
"cell_type": "code",
"execution_count": 41,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAbkAAAAZBAMAAABeEU1BAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIpm7MhCriUTv3c12\n",
"VGZoascqAAAF1UlEQVRYCdVXbYhUVRh+7t65O7Mzs+vk9qMNysm1/KHQiiFEiw4RkmntULFLKDiF\n",
"UqTkKOQKbTr/ojB2lQwrq5V+CGW4UNHHEt4EXaItpyTCKJwiCDJqU1ct0uk5595z7qfOrr/agzPn\n",
"ed/3Oe/7vPe+c2SB6a9k563TPzRjTmzGhhmjdfpC96MnN/1TM+XEXsypzBSt16LzVPFaTv1/ziRq\n",
"jpa2Qpymg9KpOL/EUfy+B1yjIdHlufz42kCDdH5ZxtzFBTfpCtsF3NoVXKeAb0/mpaE4zQVfzIWJ\n",
"fZ7P6HJxhDi7846r8eNqA1dO5+Tyy+pF8qJboafsAm4fKJhRwLf/7GDNGfHFXJi44Pkyeo5DRKuE\n",
"HRWHF8uPqw1cMZ1b0S9rPfCKJ0ShrG7UQyqGVDlVoOFFxnQoFnhhhaycJDYX0TIUPaJYvgp+kg7D\n",
"Q754QNarwKaCL+jAFqc8DStafuWPJ4qMeJxHIucDjl3aUsRWW7pahtF8Tgc10PyY2iTpMFQ6fVKA\n",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RPlo6kpdZjpR23gDydyKAj6UGnnbBdOFwwjIOlyv/8OR2f7V\n",
"tsSm8w9vOn//speZkiPRO75me43wI36sx8ZymN3/BJ77/dcKbbnE2PQO3J7jtVZxPO63IC2vr19e\n",
"X3fi7xJzD8PaeHTsD0YV0e0uU6/XhyGTBvmwHj8i/jMRtdG7cDOM+VsrQiPNcLpQWE5zrCyRy1lp\n",
"anaWMaRQeHc4C+juCIeC9n5tKqLbnfYHgeTzl4f42tF0geNTkNWWVyeStkLhnZzmEUtcMgPhUNB2\n",
"/6TwEVO1ICNokb8BayscQjsYcKxougBrKrL0r2t14GjAWIS0bdqcWz7mqy1TDUIjopuE/IPophFf\n",
"u1G6KchqV3J1m8rh7e1Ijc+jqct5oQDSf242IrqnyN95pEAjvnajdFOQJW44sdrUc3fMwLfi/BTw\n",
"xhji6hWrIdGhyaua8Eq1G6TzyfoPxiXun3xgSFsAAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$2 \\sin{\\left (x \\right )} \\cos^{2}{\\left (y \\right )} - \\sin{\\left (x \\right )} + 2 \\sin{\\left (y \\right )} \\cos{\\left (x \\right )} \\cos{\\left (y \\right )}$$"
],
"text/plain": [
" 2 \n",
"2⋅sin(x)⋅cos (y) - sin(x) + 2⋅sin(y)⋅cos(x)⋅cos(y)"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"expand(expr4, trig=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Derivadas e integrales"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Puedes derivar una expresion usando el método `.diff()` y la función `dif()`"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAEoAAAAVBAMAAAATJmVgAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEM3dMnZUu0TviSKZ\n",
"ZquXRLrEAAABSklEQVQoFaWSPUvDYBSFTz6a1ITYUOziIBVEdHIQXc2i4NQidBH8AHHP0kkkgj/A\n",
"dHOSjA62vIOgi+jg6BD8A2bQubhL8b4mNwmazQvJeXI4OfcNBPjn6HFa4Hi/i7a7hXPH+M7A2omY\n",
"gHlGlaFCaxGbBbFT6JRgVkKmTG+93DjPCYsFYvN4xw4Sffm59yHdG7pa+/e79D0Ss1F8aDATqH08\n",
"ymWngBI5a1obeKXHbOoDWDATmCEaMXnrgOVanwa9cYTmqpwFsjf64ifVRoO24JK6oPpE6MhbNrMr\n",
"XzCpy89TSKmcsgXezkop2kgtHlyg9LlGhOm4lKLTG+4BapQqnd4YwBS0jjeOgIvDAA/U+CJr06kP\n",
"96718WRmPNkKrsiiNXO91jAmXMoiFaIJNu2Q6a86T+xZXaYKPWGvyVCl+V+Yx6tStjw4jSPwDWX2\n",
"RQ0oD4CmAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$- \\sin{\\left (x \\right )}$$"
],
"text/plain": [
"-sin(x)"
]
},
"execution_count": 42,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#creamos una expresión\n",
"expr = cos(x)\n",
"\n",
"#obtenemos la derivada primera con funcion\n",
"diff(expr, x)"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAEoAAAAVBAMAAAATJmVgAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEM3dMnZUu0TviSKZ\n",
"ZquXRLrEAAABSklEQVQoFaWSPUvDYBSFTz6a1ITYUOziIBVEdHIQXc2i4NQidBH8AHHP0kkkgj/A\n",
"dHOSjA62vIOgi+jg6BD8A2bQubhL8b4mNwmazQvJeXI4OfcNBPjn6HFa4Hi/i7a7hXPH+M7A2omY\n",
"gHlGlaFCaxGbBbFT6JRgVkKmTG+93DjPCYsFYvN4xw4Sffm59yHdG7pa+/e79D0Ss1F8aDATqH08\n",
"ymWngBI5a1obeKXHbOoDWDATmCEaMXnrgOVanwa9cYTmqpwFsjf64ifVRoO24JK6oPpE6MhbNrMr\n",
"XzCpy89TSKmcsgXezkop2kgtHlyg9LlGhOm4lKLTG+4BapQqnd4YwBS0jjeOgIvDAA/U+CJr06kP\n",
"96718WRmPNkKrsiiNXO91jAmXMoiFaIJNu2Q6a86T+xZXaYKPWGvyVCl+V+Yx6tStjw4jSPwDWX2\n",
"RQ0oD4CmAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$- \\sin{\\left (x \\right )}$$"
],
"text/plain": [
"-sin(x)"
]
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#utilizando método\n",
"expr.diff(x)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__¿derivada tercera?__"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAADcAAAAVBAMAAAAQkWtIAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMnZUzRC73UTviSKZ\n",
"ZqszMyTAAAABLElEQVQoFZWRvUvDUBRHTzRpa2NFxdUSKl0qSBcFdcnUOZOgk4MIIkgGN5fgpqOr\n",
"DiI66yQUEfInqIvgB1TBSYSoIH6g8b0kfYndvEPeeffc/Lgk8K8aTqbPk1PbSl835xPu649B+0yl\n",
"7rTZbkN61hSmpFrbimZjMgdUp+Aq1OtoIxX7+IehncExS/SLPhiVx/W9CGfAZQUalvklZO4M5ri0\n",
"VqFks+GwK+USfAuZr8MBh840dLvk30aRcgFehOzxwKEhCC3A2A99KRdTGZOUJ5TeM1LGoj1jgFh8\n",
"Cp4yUi403hVQjRaadFiWmUlssUXhNReYYqbXZ/PiyiuHD+XwbuKjFWUZ99XarQjXPfH4W2vq2lSk\n",
"4EaR+EidlTtKOobdqUD9bDWVnTlNLtfwC1XgR6gJ3g8BAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$\\sin{\\left (x \\right )}$$"
],
"text/plain": [
"sin(x)"
]
},
"execution_count": 44,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"expr.diff(x, x, x)"
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAADcAAAAVBAMAAAAQkWtIAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMnZUzRC73UTviSKZ\n",
"ZqszMyTAAAABLElEQVQoFZWRvUvDUBRHTzRpa2NFxdUSKl0qSBcFdcnUOZOgk4MIIkgGN5fgpqOr\n",
"DiI66yQUEfInqIvgB1TBSYSoIH6g8b0kfYndvEPeeffc/Lgk8K8aTqbPk1PbSl835xPu649B+0yl\n",
"7rTZbkN61hSmpFrbimZjMgdUp+Aq1OtoIxX7+IehncExS/SLPhiVx/W9CGfAZQUalvklZO4M5ri0\n",
"VqFks+GwK+USfAuZr8MBh840dLvk30aRcgFehOzxwKEhCC3A2A99KRdTGZOUJ5TeM1LGoj1jgFh8\n",
"Cp4yUi403hVQjRaadFiWmUlssUXhNReYYqbXZ/PiyiuHD+XwbuKjFWUZ99XarQjXPfH4W2vq2lSk\n",
"4EaR+EidlTtKOobdqUD9bDWVnTlNLtfwC1XgR6gJ3g8BAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$\\sin{\\left (x \\right )}$$"
],
"text/plain": [
"sin(x)"
]
},
"execution_count": 45,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"expr.diff(x, 3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__¿varias variables?__"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAMQAAAAZBAMAAACcKJypAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEHarIkSJZt3NVLsy\n",
"me8Q6PJIAAADZ0lEQVRIDZWVXUgUURTH/6O7s+u6rUNGEBENFhv2YkIQQQ/zUAQFuU8VEbloHxQI\n",
"0kPggxUhPfRQ20OBRSQ9hCikWRAR1VL0IURahCElWRRBJH0X9LWdO/ec2emuGt2HPf/zO19z587O\n",
"AHq1XHVY/Yex0/Vmtv3kgYnYt73y3BShafBjPDGjW7HcROzHveTnKULT4BHsM6MdGPJMpv1UJvJl\n",
"8sj0dNQMv0JDxmTiJz6I+g9rvS1N7pvyUONuaTZwR8NYfrIgrFq3lB/wUbJVR8KVLaXJQKSf6YrJ\n",
"osTkuJMvJMEe9tVa8YuVMR2RANsKR4QREHeoS6vkVyHtWhwVv0IE1mNzoIsiLbIsy2qWELJ0Eg2t\n",
"IV/JaDaaJxPkF1XyRM95lWGsl+Jb46zOCFG2A3tlm4IHe3oVSnkCgspUofBeYNFG9wf6BKu/RtxO\n",
"L2UcucfiXaGg1EZ2yVDlzAWr0i6Tedt3wWpKZ3DjTC0hdXRWi4t1DuRp4BFM/bLk4prc2k8YnLix\n",
"QPr46dy4BVY2diCe0yMib3Dfu+thwOpHnFBlK41JjKMOaNMZ4BFMfTgX2I8LwEk3ErwhLtG1ceM2\n",
"2I79IeHpBhU59OUPAkO3nsMmFO8C1szI4QrQrTNkBFMfbnGQVSOuAd84C4fo2rhxNyxU9EtgPt2Y\n",
"5HegKntkwCOYygBOysVHmso5vAumPoz/WAg14jJUol6vaBfcWFVWuczRSCpB76qq/tmnfxFUI9Do\n",
"JH/yiJ2dnYc7O0+pdE2VgrWzMKxG0F7DI6SxGjGUh+PnItjFIw/7qL26URhF2XjxEeFdMPXLViL2\n",
"xRxBN0oab0TCqUMZj6CzQNcEXeKmLMpb9XFTceWSkuNm6o84CywzR9BxS+M2NHZdx2o/lV5Jr2F7\n",
"9/M4nniOSo9OjHrTa6iRpo1xiuxCUx+ec3BR3aXwjWqm6+TGY6iumbmDWuhV/XArIiPNmeiORduI\n",
"+H+96qZnHnCMM2SEpj5cv3tP5mah/mZhRe9vdU1q0V9PGkulDpT8dviEvjuRcY7JCHVG06y4J8Gg\n",
"UoBh24HynEXPmO1yZIO2mhrZIbf44g4qQ9GwpAOJu5UuMCdMSWtqwLB7URyzUrhY+iRFa56SF1Rw\n",
"RFNJm8QGnySzsiSXn7WYVxL5B4jwI0SVfwDYI9sGkPZwPwAAAABJRU5ErkJggg==\n"
],
"text/latex": [
"$$x^{2} \\cos{\\left (y \\right )} + y^{3} \\sin^{2}{\\left (x \\right )}$$"
],
"text/plain": [
" 2 3 2 \n",
"x ⋅cos(y) + y ⋅sin (x)"
]
},
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"expr_xy = y ** 3 * sin(x) ** 2 + x ** 2 * cos(y)\n",
"expr_xy"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAVIAAAAcBAMAAADB3ip0AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIpm7MhCriUTv3c12\n",
"VGZoascqAAAFQklEQVRYCc1WW2hcVRRdM/fOOzMZrR9G0AxJS4V+OLWoP8UM+FV85ILSUFroKBVE\n",
"i5kGNAVDnQ+xKEJTMFIVMQH9sZUOqKgNNVeh5sPRjhUR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"M2UNotJF4AxC2eZK6aQzi9gk3hvF/ipbzZXy6fPFififAbWnptLbpPnreDrV6ExpNwt0JuZngHwt\n",
"dGbKGuKTlO4C7By6qNJongKq0c+Q8DjuhFWkYy0hWidg7im/qG+75nCq5UWZSrqnSCdyiC9+BzwJ\n",
"1eidpJ3T6KJKz2ufHIN0Yqoa+EXR279pdORx8snvldLehR019ONQnaadgJWlMs1KY0XEr1pzIQqH\n",
"c1Ki9hSGEj117LNfRqr0vYPNkgY8TUdaG8AtZPdpnxyDdGKqGjgJfe9nGo2/ySe+V1JCr7NvD/0g\n",
"GLuN9jp+4Kv99vDlh4Yv3z/wiorTaUT2npr9k8xUWfp0pYYSkUdms7h+9DEc/OM3RRNHvr2660Cd\n",
"ZB9Jqe6DdP7yyxo4Sdg/c77AgbYpYHvmlId6FNKVKrOjEklavWyhcY3aj5LJM3GSlOuxNnpIgmgl\n",
"4j2DQEj/LCI3/ZsSLV5XgIallMjkNDHmatR+JKaaiZPsdjzWNg9JkHQtN+DyTEtvTKTi+XywlBL+\n",
"jd3pK9qjzZAziSS/+pxozceM4tX1zQ7D8n5JeyUbwSWVgP597Jdsak28Ts0kkrzlR9pujx9uRvx0\n",
"uf0kh5X0/MXgltHnIs02vWZykkzJIJwx8JqD3klwZenA8a+pajesqWqWKeY/p5d/ytKNjUQAAAAA\n",
"SUVORK5CYII=\n"
],
"text/latex": [
"$$2 \\left(- 6 y \\sin^{2}{\\left (x \\right )} + 6 y \\cos^{2}{\\left (x \\right )} - \\cos{\\left (y \\right )}\\right)$$"
],
"text/plain": [
" ⎛ 2 2 ⎞\n",
"2⋅⎝- 6⋅y⋅sin (x) + 6⋅y⋅cos (x) - cos(y)⎠"
]
},
"execution_count": 47,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"diff(expr_xy, x, 2, y, 2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__Queremos que la deje indicada__, usamos `Derivative()`"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAARUAAAAzBAMAAABLQoFOAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAZokiELtEzTLvmd1U\n",
"q3Z1ltcVAAAFyElEQVRYCc1XX2hbVRj/kpsmN7lpFqqgE9G0FYVCS1QqdAq9KEP6sKYy/6Aghj1Z\n",
"9tA8qHmwzuiD1YeZgjqnDxqHpboH3ezbkBEGexALqzh1iLBLfRDBtd3cZi1q/H3nz829t0nKxCz9\n",
"IOd83+/7fed8Offc+51DFJChQTuAdMxMpBMTHZs8MHEiE1oLQB00E4UOTu5OHerrhz5WcoEOKv20\n",
"O0/jBzqYgTt1qEDmLNG22LsJJHKRyPzLza6zyomxkoF8Oi/mrfSOlQ293flMyJw27tgwhwaz2yCX\n",
"yRJ1/7MN8kAKBvKIXd0euXRfJorjVWouA0/ZzZ3NPOHls0FXeO7jIBSwdxSIcpkA6DXD2W5QrlU+\n",
"orlgSD/9EIQCdq5CtGoHQGG+JkEra/7eyN0aO0K3BwkLVN70fqR8pJxD9IUPUYY5IZV43vhP22k+\n",
"OOghGs0HseiSF+laavL5j9malsSWumaJHN4ccsbehPV6EeP4Q0e9tqt/5mqW46oexUxL42YPVlcj\n",
"vzh1Q2snhaIDQyWYli0w1SR7Nz1F9hj1xRjw0l19WGndJRfyKXrvmh9oOFwRmg6kczBTEhOOpo0K\n",
"hD/UmP6cDi1oxd+Xq9I2L2n8Fqm4gTHYxpr2tujjVe3cR89q1dOnMtpYVkrEs77YLaNpTVB9NBMt\n",
"Qa0HCu14gNXILNsKNacXH21AiLszjylv0vHQFmin7TFZnVk8zVA9MDILUz9KqE1lp/bEa7U1rXv6\n",
"/a4eq0rVl8ury98qgvG6Uj6s1VirB9I0zF+Vt1U3D+f4hfuWHUWKHOmr0oMrd5L520oBG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9zFXmNLqtKzHU4he+OLL1tn943Qc7ha7QumFgTnC+sjC69PmrbjS5xjdYFE9Oh\n",
"snOZ8hTZtuegJ5DXaF0wgd5/464KOk+R1dT295uu0afUB7RlkW1/XvUZtiqydWb7tS2LbPtTcGfY\n",
"ssi6zP9P+Rcs14+zxsURUAAAAABJRU5ErkJggg==\n"
],
"text/latex": [
"$$\\frac{\\partial^{3}}{\\partial x^{2}\\partial y} \\left(x^{2} \\cos{\\left (y \\right )} + y^{3} \\sin^{2}{\\left (x \\right )}\\right)$$"
],
"text/plain": [
" 3 \n",
" ∂ ⎛ 2 3 2 ⎞\n",
"──────⎝x ⋅cos(y) + y ⋅sin (x)⎠\n",
" 2 \n",
"∂y ∂x "
]
},
"execution_count": 48,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Derivative(expr_xy, x, 2, y)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__¿Será capaz SymPy de aplicar la regla de la cadena?__"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAACoAAAAVBAMAAADCwWEQAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAdrur781mRIlUMhAi\n",
"3ZlAc+EGAAABEklEQVQYGYWQQUsCURSFj+BMz2aG1DbuCgxXQUGtxMXs3AouIlw4m+hXhILQMl0X\n",
"gf+gEWk/uNCtLtvND4ioIEok8tz3fG67MPec882bdy8D/FO7kTngDkWLf+Wzow9gYiBQ1eaLvQK0\n",
"LHXE7PywXSPTlSClnVrS3SObCJHyQjZnBR8PuBFg6pKyN8eUcsdntD8r5Y3tpKiRcJ7XdRdBA7hi\n",
"7DfPQ8oLoGK1yiXAI2M79k4pdZ6Fc0iHJz6/8CIKKWfwVk31urS8gXmIGLKO+paop+XiA2RIOS14\n",
"N7QHdAYnesk3jNufrxrzs3FhdBsxXJhz0oPEej+0DnBT65VeZJOOLX22RnT717evhfqRdF6VYA0C\n",
"4jc5yL+/0gAAAABJRU5ErkJggg==\n"
],
"text/latex": [
"$$F{\\left (x \\right )}$$"
],
"text/plain": [
"F(x)"
]
},
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Creamos una función F\n",
"F = Function('F')\n",
"F(x)"
]
},
{
"cell_type": "code",
"execution_count": 50,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAACkAAAAVBAMAAAAp9toTAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEHa7q2Yiie9Umd3N\n",
"RDIfxLosAAABE0lEQVQYGYWQMUvDQBSAvzMaTU1LQFBxanWoODn4A0TUOYsOCpJFcGv1D2RztS6O\n",
"0lFcrIsuQgMOLkKDq0sHXZyC4CCIeO96udU33Pved+/uXgL/xLvdPzBZLW1u+W38VWvHhwLLMcFV\n",
"TBhZS6Zh5lYvNwnNUhoaSM8rnDo7D5UvqT6o9pwNO7RMNctkF9Ti9ssJgml91OPFMMd+/QEmMvrD\n",
"kZ3uwDFpdAFBjzMtV56fmMoh4lFaagV9yWluLHxaqyeFAcgN1H5RyDitti5+QF47HytomNcCfejt\n",
"Xo+zTvXbK3y9WenCwtp1fGmOqY1Gc0ffE+Z6sXFXAkeOYM+x/jwXXmJRZRYkub/uJVKWcWhhF/4A\n",
"4OA6mczTMxUAAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$G{\\left (x \\right )}$$"
],
"text/plain": [
"G(x)"
]
},
"execution_count": 50,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Creamos una función G\n",
"G = Function('G')\n",
"G(x)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$$\\frac{d}{d x} F{\\left (G(x) \\right )} $$"
]
},
{
"cell_type": "code",
"execution_count": 51,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAOUAAAA4CAMAAAA1t8/VAAAAOVBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACXHtMAAAAEnRSTlMARLvv\n",
"mVQQid3NIqt2Mmbz+71md4jWAAAFxElEQVRoBdVa26KrKAxFRRBBZ4b//9hJQrhoaavd6Zk9vhS5\n",
"LLIkhCRUqd//bL9fRAEJJwGM3w8hzXIYJy3KWgRQmqVScRZlKQIoznKIRpalBKA4S7vIklQSgOIs\n",
"ney2VEoCUJLl6m3YJLelGKAgy2FalRoFt6UcoBxLM+2wI7UT25aCgHIsNa3iYsVYCgLKsZxG4Gfi\n",
"IMZSEPAvKaFMxFWcIzCVgZQE/FtGJFxF9HlGp2awQRKPJKCcxrqg1L54JbYxBQHlWBof7Lb68GZj\n",
"bmiJm2d/GvtdBESsM2jCr9ByLBvJD0UTRu/9rlZa5BVt1OHxT2keurUvYYwRQccpggIpVUCH424p\n",
"0F9nGegYVbNOv+7RNn1ywkYeNJJmFNAA+tROkKG/zNKMC8+qI37n0Nm1vbp25TrlgQw6NOy4PzLA\n",
"sOgQaHHzkNzyZZauOHwDxSroBJ4fc18Gm73lGdWdQYekvi18hr4/Q4vyrqxjsTUbxiqJ6nmUux13\n",
"p48HX2wGTcmgrsOFoTstZyE+f19jDTYNrqLlsMyE4Nch2KReufb6RIS78hfMw12drCBx21dZ2rMO\n",
"JWOhDOzOfQlqSdZhz0aiCPemMET8Wp61n0EV1IZAzLdiyBn6qyyXeDollqSbaAct7Fh2k+bOIrzk\n",
"aaPzfsqiMyicJzYEmGDTvgAydO76EvV1Y+w/MGgCrxafoJ1zaF2n5DKg2XXle6uNu2FX1QfLtdRF\n",
"0bY0Pr1k0C2/w24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KvGAjP+B89KGdWcm8cUKtmdQvvP\n",
"ifzBTLg2c9W6zloquNCAJ7mXBq3PGukvgGR691dnEI77NY9ZJsua2mOpLDg+Nl2YK7x0hRNtgCsJ\n",
"cg/8nfzbf8x4dzF5xl2WrXDpUqnW9JM2tf13lVbMXG4h6ueOXhK4aje+z6/939/FUe2Y/Lr0DC2v\n",
"cu90aej/qROnyUlk3Jv/AhnaKuAyNkVGAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$\\frac{d}{d x} G{\\left (x \\right )} \\left. \\frac{d}{d \\xi_{1}} F{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=G{\\left (x \\right )} }}$$"
],
"text/plain": [
"d ⎛ d ⎞│ \n",
"──(G(x))⋅⎜───(F(ξ₁))⎟│ \n",
"dx ⎝dξ₁ ⎠│ξ₁=G(x)"
]
},
"execution_count": 51,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Derivamos la función compuesta F(G(x))\n",
"F(G(x)).diff(x)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"En un caso en el que conocemos las funciones:"
]
},
{
"cell_type": "code",
"execution_count": 52,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAACcAAAAUBAMAAAD8YzkFAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIpm7MhCriUTv3c12\n",
"VGZoascqAAAA7UlEQVQYGWNgQAM1Kscc0IQYeAKyuRoYGJWMkWVYGPYB1YUxsP9AUf4RyEtlYJiJ\n",
"LMjygYWBYRYDQ74DQlSefQE7A8P+ABTBsBM1R8FK1geE6zAwTmVgrTkkANPD8Z2h4CYDzweGLgHG\n",
"ApgglwHjBW0GZgPGuQxBDjBBZQZWhjkM/AfY5p15ChPjSWBg4PjK4O/AD2TAwCUGRgGmDQwnGfjh\n",
"BjKwKDDwCDAnMJgxcAIFD0CUSpUXZTEwGXD8Y+DZwBAkABHc////LwbW9ENALx869wAiBiOBpqKD\n",
"bIb4BnQxhjUMNhhiDD2HHJAFATXPNMuriUczAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$2 y e^{x}$$"
],
"text/plain": [
" x\n",
"2⋅y⋅ℯ "
]
},
"execution_count": 52,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# definimos una f\n",
"f = 2 * y * exp(x)\n",
"f"
]
},
{
"cell_type": "code",
"execution_count": 53,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAALwAAAAZBAMAAAB5tlnFAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMpndu3bvImbNiRBU\n",
"q0Qb3U6NAAADLUlEQVRIDa2UTWgTQRiG3+02f7ubGAQPnhKlIipiDq0FEakiKIgYhFCtlkYQBA81\n",
"lJIWEQ1CQT0F6SVYZKlKbUHdg6VYKAT8OUilVajUQyUiiPTSH6qCwa7fZGY2myaHKh3Y+d7vnW+e\n",
"3ZnZXcDVBo9YPNMa9rjsDZJaKpjlqCF82iCmC6OmlF88bUYk5RrYGOkt+FY5qRM3ChvDrKAYRZlO\n",
"WdrpLe9l9l+xGqDGJagJ54LZQzJzRyXDM3/Y7dbQErDZGRuUSosiHMjIrCJ2y6xqbV0Nh+UYixLQ\n",
"KE1/VKqbJDbVPt17siYghYj6NJ4V3B4HeC5Kbx5fuAyZoTAiqLV8jymrHTXGnaAFb1IOssgBvf3C\n",
"UwYmT3C5dfLV2OIDmGLAHbzOmvSk8F/z6I0huFQu9QmAKfFe217kw1dsW5+ZT1jlYkd9dRQGhBT4\n",
"QLECLwD+VD/0wTjSAjae2FkmAPrukTzGE0+hnE9kaYCd/mj79bY4l6xU4EmpRUEqQ0bRD81IooNV\n",
"AqFmXOWK9+m8cklpRn38ORAj6zjd0fQ3qXSr26KujF8wOckFMQl/rS6LoxKnbxPTSiEHY0k1oSx9\n",
"s2CScxDQLK1opICXoq6MbxSkdF5CjDDhLW8cP3jxx74zlpjGgr5MXSQP/FZXWpnRSR4CLUxGWEfN\n",
"wde1CFIZMg7CY8FSxKH/Kc1wuhC761QBWNGH7ShpwtMnEWd9CT+cy+3P5e6yHO10lUhlyLu5uZ8z\n",
"2AVPkhXQU/Ige+fpl3vgZz882hwCh0FLlC+RfHojih5OqoDQZ3US9dOceBnwcMX7HGB4owitvgVm\n",
"yaKjNawOeAi/9mjp59LKSRWQFaABCxmOOwu94sVMZzCkXEDAfGPhGJU8ofXnT6GX5HY+Q+6978DI\n",
"3hgnuSEP7VlMPNqX4sWeHbfELB70D20pdI18xnzfnQJZtCMTidHHGZL36WJNbE7Atu0YJ62FgPZs\n",
"fU0VjwH4kmKG3HuRVpOCWZ0d23qaPyqrtLhQ36VDsSZJjdfLWldpbckOoNReSOGONUmhRMWX6q6v\n",
"0t3Sce4jDRb/heSe52hfhku/cwjOULX4C4RE2yW5cFuhAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$4 y^{2} e^{2 x} \\cos{\\left (x \\right )} + 2 y e^{x}$$"
],
"text/plain": [
" 2 2⋅x x\n",
"4⋅y ⋅ℯ ⋅cos(x) + 2⋅y⋅ℯ "
]
},
"execution_count": 53,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# definimos una g(f)\n",
"g = f **2 * cos(x) + f\n",
"g"
]
},
{
"cell_type": "code",
"execution_count": 54,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAVsAAAAZBAMAAABtBpANAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEM3dMpm7du8iZolU\n",
"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y^{2} e^{2 x} \\sin{\\left (x \\right )} + 8 y^{2} e^{2 x} \\cos{\\left (x \\right )} + 2 y e^{x}$$"
],
"text/plain": [
" 2 2⋅x 2 2⋅x x\n",
"- 4⋅y ⋅ℯ ⋅sin(x) + 8⋅y ⋅ℯ ⋅cos(x) + 2⋅y⋅ℯ "
]
},
"execution_count": 54,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#la derivamos\n",
"diff(g,x)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### Te toca integrar"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__Si te digo que se integra usando el método `.integrate()` o la función `integrate()`__. ¿Te atreves a integrar estas casi inmediatas...?:\n",
"\n",
"$$\\int{\\cos(x)^2}dx$$\n",
"$$\\int{\\frac{dx}{\\sin(x)}}$$\n",
"$$\\int{\\frac{dx}{(x^2+a^2)^2}}$$\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 55,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAALAAAAAqBAMAAADhZMxIAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEHarIkSJZt3NVLsy\n",
"me8Q6PJIAAADbElEQVRIDc1VS2gTQRj+Nt2817hUEUSQNJUevDSKoodKc1AUxFI8qCcbX5UeikXE\n",
"BygELYIKGg8eoohRRARRCxZEfDToQQSlAcFLKRSp4MFHq7aKtsZ/Jjuz0921UmPAH5L/+7/55pvZ\n",
"meVfwDvCpjdfKav3VcdYe9hcHWOg8T82rq1f0xB33UnlO9bSwaOhbBWMA2ZgNJKqgrGGcI/L9t9c\n",
"3ux4lYz7C3C/W5VfXsRshK8axm35Pqx1n0XlO56TqN3d5TJ++fGYmyTVU0t52DWDE4Y1KVjwHp/C\n",
"Gq/tUu+xcE3BJhW0XuAmAabJxrg9aDfTrE0q6KzAYQGsPNdRO8sGSdhIUoAvLQoblZkrYuA3eVjy\n",
"CyVSQCwlCm1IoHL2MtafS40/I2E4L6ENttjwvA0ZchobixPZ9Z/x7P3j+jgNB4qAlli2cXsZQnvV\n",
"nse8xC4wHY130s9qlgwq4TReAGRwB7gQ17+QLNoFzMPB+AkgyIxa8saw0Y1onOuAu7Su1SwPKa4E\n",
"ncZbTaSZ8SPgKw2H8sA27DGvApEM1TlEJkJpGBNcB5ykJ7Ga5XWUeJCKhTDm3Ag5/VgEZnwP+ETD\n",
"sVZQW7nAlAaNapME+vPAONcBb4izmmU/E1nRkcudzuUuipJlraNUZMb3beMy4sZ+tthtWuwH13Fj\n",
"oNwsVWNSiR0zUxarERxTjNlR0IPTtsBeELnjSa7jR0GPwJul8oLQHJfxNWCFYswu77JvBHXW5eXo\n",
"rGNF+Me4jl+eaJZ/uLxbJnrZOVhHEUjC/z06opP/rCLto6ULO413CKe5DtgBiGY5yPZph/MoNu3d\n",
"3/qktORJqenGzyR/fm1pXcMBmhBupT9tVUMKG9qXg+mopucXzfIcoA/eLxDJQxpvGHggODV3y6JF\n",
"IgWEUqLQh2gNBMZEvdkCWhJ72BaccUQS2yVSQLAoikAcWAJ8ELXINSZiQ6JQcjRlFVpWYW3YK+B8\n",
"Am+B5oIgrBzLoGbCwbFSNnq5wlSRbPRshUum2zg86m0sv477phqKir0vLIIpnnDGLGf1PzSqVn+H\n",
"/crHRzq0pSX8axDq8Zh6yoObKTXgMWGW12IeuukoX9JjtN6Dmyl1E3rKOSdSpM5WYRhF+FJOjxcA\n",
"tfjKYl1750qng368/WXGSc60vlQqfXPOCdO3qULjX6aK1v0zHaStAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$\\frac{x}{2} + \\frac{1}{2} \\sin{\\left (x \\right )} \\cos{\\left (x \\right )}$$"
],
"text/plain": [
"x sin(x)⋅cos(x)\n",
"─ + ─────────────\n",
"2 2 "
]
},
"execution_count": 55,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"int1 = cos(x) ** 2\n",
"integrate(int1)"
]
},
{
"cell_type": "code",
"execution_count": 56,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAVUAAAAqBAMAAADxIdW9AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAzRAiu5mrdu/dZjKJ\n",
"RFRer8KoAAAEwElEQVRYCe2WTYgcRRTH/9Mz+zFf7Y43MdEOBpNADgNJMAjqgDqCQjIHXURzGBHB\n",
"+EEWlMxlMCvBk6gDkQQ1yIhKDnoYEIMfhx2RzYKuOLmIorBz8GBAUZasH6xxfK+qq7uqa+MOUn3b\n",
"B9396l+vfv3v6uqmAGQCpBdu4dnDKXp1C/fuPpaeV+fwE+l5BRzDHeNghGO4Y5xhdWtezelw1nL8\n",
"0hzjzMd0DHeM2/IazsDWvKYyEbOvnO6aayxsfWKrxbCy0LP7gA3Uq8EVSMcobQMMlb2nlRYf6Wst\n",
"SrM1s82t/Up6UiXRNRMAthp2n98W1ckkAml6pNmYa4FJfXr2NLVxlGYCOiWCxsjIqERdxYbKUlWv\n",
"d1pl4TUCaXqkWZj9q1Q2o5XmmlqD0rbZ5NZUX2lxJhW5oUqqqhqoxylnGxXGmsq8qhy1c5a96n6S\n",
"Xk/KQv08HQ4GvHld55z/JraqqhJeY5AqAGJNYfy5sHeKve6OS5HwWu5ofWH6XSzdEKcyE38+S1VV\n",
"Ca8aSFVA00KM6TUzjErZq7fUHqD81EOtGlBq0DwdWR5ib+srFJ9rzVDlIh27jt/Wpufl1Ajh1VJV\n",
"CXllDr5ZPPcsaVy3Odz0yoZUkNePq7gHK0G+S2ZyXeDgsHiyeAq5uZ1Ah+rupTv0C2fyM8Bbapi6\n",
"Cq+WqnrrEJzyKl6fkqAx4KbXAt1VBXk9Cyz0jmKSfeWHQAX+er6P4vq3AfqkvUnTHZRW/SpwiZpG\n",
"CK+WqkrqEBwiH2WJQGPATa9+ByOO32hsrln8B7im/6D0Oj2At0bywhD4O3/5GUrxEs0rMjVOF/i0\n",
"4zWO6zmVm+qkGsHrkjMxL70yaDM4YHotsskwck3/Cnmt3dHbPSSJvJb/oOuvA+Cy99moQTndgirm\n",
"+CxccaJCzKulqt665GTXvZdZItBm8FKlct3zlQrfFuI/YHoV89q4ZelL7qc1ED362j4U6DnEq6NV\n",
"ggD6V8vV4bxq37JU1VnO61q23e6xRGtgDLg5r/qPidbrC8DK4BfJz3V5ScGfbqB85WfgCZLp2/KD\n",
"E5gK/se3JTj+QMIJNAbc9Gp8WzV81MM2XPz+AwaWmvQf6OLz4ovI9H8KcCdpF+hZhodxK6UP0GGE\n",
"WAOWqkruguCUt39aZYlAY8BNrxNiOQhg8djv1eyRCwNkRiOaX/CUe4+1qziw/DR+OPc+zwi94ptb\n",
"u77oUrqdDj3khiqpqorzo0cFBzeO/uRb8lrZHK68Tjz+F73VDDk4cP99Cimuh3DTpTnKThmqaOSr\n",
"SsvOq0y/2moCnht6t5+hETEoHh5rCqO8ypqD9HhNfE2Oo/BrtBGlA+9GUpQUGiot8dNYYalJ+I80\n",
"5B06YlDMiDWFKXfjXmCJ9oUBpuc1zXuDfrVDEnLRJMa9vGhF7FCJcbXUJHxPDzjEQyKQNj7SLAwX\n",
"eTP0H+1gcl0bgb1L7Ye5na3pqsyj7XDENWosNQn3lluLZFfbtGvj/xvOU5dZTXiNRvPnnohsVwoF\n",
"GmiHrV4VrkA6RGk2hqvelqV53h6mFY7hK/20jBLXMfzVFK3CLXyilqJXx/DjKVqFW7jfwL7U3DqG\n",
"fwiIjXQqft3Cs2eXZzup+CSoYzhtq0apeXUL/xdt3nue1qbW/wAAAABJRU5ErkJggg==\n"
],
"text/latex": [
"$$\\frac{1}{2} \\log{\\left (\\cos{\\left (x \\right )} - 1 \\right )} - \\frac{1}{2} \\log{\\left (\\cos{\\left (x \\right )} + 1 \\right )}$$"
],
"text/plain": [
"log(cos(x) - 1) log(cos(x) + 1)\n",
"─────────────── - ───────────────\n",
" 2 2 "
]
},
"execution_count": 56,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"int2 = 1 / sin(x)\n",
"integrate(int2)"
]
},
{
"cell_type": "code",
"execution_count": 57,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAGwAAAAnBAMAAAAY17BRAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEHarIkSJZt3NVLsy\n",
"me8Q6PJIAAAB00lEQVRIDe2VO0jDQByHf7Ft2sa2BhXXxuckKA6CW0DFSeyki2gHUQSLHdxEqA9c\n",
"BOlaQaiOOrSOgmJXB2nFsRRcxFGDuinxmsu115TztYhgIJfk9913j0DyB0RHc+dojyaCwlyKejd8\n",
"SSEWAVmVDUUXUWEuwZ8Vwo9Ak/YRFbJ8DqoQioCi9qHh+9ps+gJjojHFeUtH80JcjP/J33wD5o+O\n",
"39yr+MOUi9dsYbFzx4ehGAzVXecwZGey7krW4jaxtoW8Tjv79MAzuRsvnjG53alV2R0mIrRbKOJ+\n",
"AaR+LNtB4MChcQzIVHZU3otLReiWjiNLTGulAceADZqR1qcBoQRcrzRZqWiHNOAY5ALNSBsjp99g\n",
"mqQ5tSoD1iqW1x7AZ8A92LuulEpvcQrt2ciDzeCJenKgZWES01av2Shm9MZHwM32VtUYuzw6VmlZ\n",
"COwdnVjaDqR7BLPA6lPaClDVGHswTdCyEDJNMgPKQtCwXg91SFvRalhtWegkrzOLcI5Ji6nUbiq1\n",
"bz06GFcWlAJGwlFk+B8+m83JuLJwBXSF0zjlixnTahlfFtzb8zcJv+bdlNkiydXWHIwvC37yU0hI\n",
"A0vD3fWag31aFtgiuZG+cjv1Wad3l9O6bPxA2ggAAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$\\frac{x}{2 a^{4} + 2 a^{2} x^{2}}$$"
],
"text/plain": [
" x \n",
"──────────────\n",
" 4 2 2\n",
"2⋅a + 2⋅a ⋅x "
]
},
"execution_count": 57,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x, a = symbols('x a', real=True)\n",
"\n",
"int3 = 1 / (x**2 + a**2)**2\n",
"integrate(int3, x)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Límites"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Calculemos este límite sacado del libro _Cálculo: definiciones, teoremas y resultados_, de Juan de Burgos:\n",
"\n",
"$$\\lim_{x \\to 0} \\left(\\frac{x}{\\tan{\\left (x \\right )}}\\right)^{\\frac{1}{x^{2}}}$$\n",
"\n",
"Primero creamos la expresión:"
]
},
{
"cell_type": "code",
"execution_count": 58,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAHEAAAA6BAMAAAB1z6tMAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAiUSZq1TvELvdZiIy\n",
"ds1Wk1T5AAADPUlEQVRIDe1WTWgTQRR+2SbZ3SbZBgQ9le7VgzQHFcRDI3rT0pyq4iHFKgh62GLx\n",
"JslJPEmgx4IU9OBfbU4ePAURhIImAaEglObQQ0GEgFSpVurMm5+dmd0NjWfnsPO9771vdnZm9r0B\n",
"GL6lg+E1qLCONv9RCe5/5eCly2+dkgEpX8IksBjvOBJPq6zV49YBb31qp8qcHdS9VpwOHGfW7GFO\n",
"k1MMpR7UUGJfD7lkZN9UfVfRcEoql4hnFY/9FY3qYSYL4CrTXWSSJWUwBu3NiyfGTTbzG5lc90vZ\n",
"PrtA8Shj1MAFeN55rBKI2RsyVr3oHuxRxq0jrz6OwURwTSUQr7EpFjrC0/YFkn0AOxKHoIaSlONX\n",
"OHc69IXoTwgl8noUplfHW7Qn7QbrtGd+H2yNoEbBWJD8r0gIXC70YSNC54yJmCMRgbXr9HMrESXc\n",
"0ilnTreJZU9vdF9EWIAHOpet6/YAa6KpOWslzRxkrPmadxJ3SaOSjLYeWq0kBUZ4Y3pbrUhEEjFW\n",
"1jxTTc0cZIzVNe8QymxPU84EmjnIyDY07wyzRDJM6DHInYtTalyCYSinDj9bV5+tcaQSXoe08Z1D\n",
"7KextsZhVN65zvErwRn7WfWFw+hzdU6kWxwYp0+ceIu7ZefJpetxzjjxYqC7UsJBVxICGT+H+Own\n",
"MpCD25K4x5GxDU4f+cx3GciAFW6eV2EUP24isPAT0dO9CxVY7Xbg0/zHzx1CpUokIbH6QiFtRgbL\n",
"7zKaVI3MMpwE2OnkaGJ1VgB4fRntYYiZNUWmpso7MBnQDEdTsEumyOtLpoHKSH6dQhqIEvJd8rc+\n",
"AqApOesD8PqS72OIwwZAjI9JEkIaUdo7zXYLHoZKhoArxzoYGD7cEuIl6HgNaH8IuJLOFlh94cu8\n",
"FoQiRKNscbehWCtC9V2LK+kK8frCV2jbEALMI3MGiiTdT6yLd5JLkqgvIzgryyhlRMVuGOlzzdz5\n",
"zfvf3h9cuvKjTMpSQ9YXz6djO+yrKBTNi1LUtSz88AZRzH0rty9jVBAeZLymxN632IVKVVHsNDlj\n",
"9yiImSzASJm6zCb/bDbEM9OP9nQs+5azL2kvb6l66Iiv2zEWv68pnr9tteOIGipp6wAAAABJRU5E\n",
"rkJggg==\n"
],
"text/latex": [
"$$\\left(\\frac{x}{\\tan{\\left (x \\right )}}\\right)^{\\frac{1}{x^{2}}}$$"
],
"text/plain": [
" 1 \n",
" ──\n",
" 2\n",
" x \n",
"⎛ x ⎞ \n",
"⎜──────⎟ \n",
"⎝tan(x)⎠ "
]
},
"execution_count": 58,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x = symbols('x', real=True)\n",
"expr = (x / tan(x)) ** (1 / x**2)\n",
"expr"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Obtenemos el límite con la función `limit()` y si queremos dejarlo indicado, podemos usar `Limit()`:"
]
},
{
"cell_type": "code",
"execution_count": 59,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAACEAAAAWBAMAAAC8tehJAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEIl2mSJE3e9UMqtm\n",
"zbsXyEShAAAAjElEQVQYGWNgQAEbUXhATlIrughDKa1EFn+ZgGE0TIDzHRA8ZOD/////B5gYhF5j\n",
"vQBVgOEZ5wU0EQEmBaAIo7JJAEyCSw/ESg9gVYCJMLABdbF2MogsgIkYMHxlYODuMT4IE2Bs4Gpg\n",
"YODfAOMD6ckg2/kVkETATA6giAGKIPMFBhG47RAZE5sDKEoA0TYeyV9YhCkAAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$e^{- \\frac{1}{3}}$$"
],
"text/plain": [
" -1/3\n",
"ℯ "
]
},
"execution_count": 59,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"limit(expr, x, 0)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Series"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Los desarrollos en serie se pueden llevar a cabo con el método `.series()` o la función `series()`"
]
},
{
"cell_type": "code",
"execution_count": 60,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAABMAAAAQBAMAAAAG6llRAAAALVBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAOrOgAAAADnRSTlMAEIl2mSJE3e9UMqtmzXCQ\n",
"kgMAAABlSURBVAgdY2AAA2Uv6wUQFrPAXvYECJOL4Q6EASKfwplcD7ig7DimAiYoU9pM2RDIZFQ2\n",
"CYCKpAewKkCYrJ0MIgsgTO4e44MQFgPfBiiDgYFPAc7kADINIDzmCwwiMMNMbA5ABAFElA6yXWTQ\n",
"swAAAABJRU5ErkJggg==\n"
],
"text/latex": [
"$$e^{x}$$"
],
"text/plain": [
" x\n",
"ℯ "
]
},
"execution_count": 60,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#creamos la expresión\n",
"expr = exp(x)\n",
"expr"
]
},
{
"cell_type": "code",
"execution_count": 61,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAVoAAAAwBAMAAACiZ6/NAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAzRAiu5mrdu/dZlSJ\n",
"RDLkM64aAAAFz0lEQVRoBdVYXWgcVRQ+ezeb/d9kiyIiIUOVJg+BDlgfDEgWqdInEyWJfSi6WGjU\n",
"B10iSX0omBYFRZSoFX0QXfAH9SVLS+2DYLdiuijB7oNVEGn2QcEHoUm0qbE/67l35mbu7JyzyTYL\n",
"0YHs3vN95zvz5c7dO2cGoIVj/gGLya6c4xjIMRKAzDODRZbcMpGyO7vpIpFiJEczkFxhCIB0fZXl\n",
"tk7E7cyfdJVIObFEMzDQxO1XFiNqBxyrhq9zdSLMrMNkE7dVrlp7cP6y9tfoM2RONHH76JRFq9qD\n",
"xgtMnb7bGCIleLfCTuYYWVvgebYK9yv7sIlbAMH8DtjTtEIkRtjszFWSEoUmbjtswf4OyGqtgb/A\n",
"RVrQXwv/QzLJsbHLRZJBMG6H+WXCiTaNZ+748n46OW4njtEMNDGUslL8xWLKbQrum77vSCFWry8F\n",
"shWTqZyzGxlx+OBPFYCPVkuNDMZKBQsHCGrrkCgn3ol3U3V4ZgA+K7xBSRDjVYygJRiv2UoyMHuy\n",
"BM98Deetk8x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CgaJ53S5Db0C8GztQYAzVlCqkc6SHqnv931R0wDvMYzb\n",
"fbTOFZQZt70WusW9ddHvyFdLdJthomxGG47jOCXEsfzHVJWAEUJBwmbcIv3BzsvotkBrFXrK5PaY\n",
"wcbjxTKVI5aLXpPvT0BBH/XGxrkhpa+FrwFcIou6dZLmxD/iL75RdJxMEHUL9lskhYIy7zae29At\n",
"WXVzoG9zNiRrAHPkUkBBssa7HQWBc9t0JRhnaXU4zQiOotsixaFgAFi30TwArtsz5sWmqtwclhyB\n",
"u0kl7gnk3ErBF4cO/T0RUKl1ewrCNi6VOStAtwPAO+hzZB3cMfdThCsI3h1U25cZgaj9PJi3QarI\n",
"TWLh9xbGZ0ltR1msP/gbCVrwl4G5Qzm39y7MPwXxkng9SLcBCeFTCe0W5sdrxAlcwTd1t8XzUlTb\n",
"11uvr4GoTFNSL/V/PfoX0LjCXF+s8nwAAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$1 + x + \\frac{x^{2}}{2} + \\frac{x^{3}}{6} + \\frac{x^{4}}{24} + \\frac{x^{5}}{120} + \\mathcal{O}\\left(x^{6}\\right)$$"
],
"text/plain": [
" 2 3 4 5 \n",
" x x x x ⎛ 6⎞\n",
"1 + x + ── + ── + ── + ─── + O⎝x ⎠\n",
" 2 6 24 120 "
]
},
"execution_count": 61,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#la desarrollamos en serie\n",
"series(expr)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Se puede especificar el número de términos pasándole un argumento `n=...`. El número que le pasemos será el primer término que desprecie."
]
},
{
"cell_type": "code",
"execution_count": 62,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAApYAAAAwBAMAAABZBifjAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAzRAiu5mrdu/dZ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YvQZ/D0wTQra3Ah9u\n",
"sGEyIy9qSkLh3zb4B7F9744coFo9Gz5vB0LuAAVl30KJR5EftQpqfz1A9kbp5RF9nRDLTMkKtrla\n",
"illVNcrfEW682R+6o/OQ3UsceOrvb3WoUWqhvRybWKDXbecBDnR0AAqeN9RyI1h41GnO8a8Is2wd\n",
"Rtu6cxyh04SUulhLLUfM2vd+0Daa5ffinbyIj3s4YbEJB/ZS01fr9mvpsVyT8XgAa+loMBRYbb6W\n",
"wg+vaYfDJ4s4iHDbjXeYBpQi9x78d63yRULWAtZSx5GzkvfN+J0CTsCZpWuQWcwPQfECcfI2VBep\n",
"YTLT7OU7Ch0CnFm34X1ce1yi4MNbtuz4ZisionNc+GHVDthh2MI7MJQacDNeI4p4xw9uuOfZeUJ+\n",
"vWXLW1t1nBLNSt54/Vnv8GaD85C5kJkUx6WYUFxctlEj3s9oZsFM3vmo2oCcvpaH8Xqp8XUF+XoU\n",
"E7Uk+D7wf2RyiVU8ogA/HX41Nym/WAkYZPGGO6SQfaB6AQ4+LtaBvPfh00KNN0Na4TT+01J2kjh5\n",
"3MHbqZHqkOmyDT80N/NlvVmmbe3XIK5gsB7FRC0JLkxbdGsIUEpYy/SP5/DHeD+CNd0AhAP82PdM\n",
"TSFnQPVCNJyVvJ+F0jmDWdGBwy34JKyZpgkrK6DYokaqQ6bLNlzV6+FNRrvNbOpq4lJQXr/ghEFa\n",
"miLYmt0dlabxnUnhh/IpWLtne1iLCxVH8PFDIi/2tuk5Ylbyroxv7JjMjo1/Cj9mjW93Of/cjE+a\n",
"1GgziyZzJXKZKvAfdLH3Zm3y5rIAAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$1 + x + \\frac{x^{2}}{2} + \\frac{x^{3}}{6} + \\frac{x^{4}}{24} + \\frac{x^{5}}{120} + \\frac{x^{6}}{720} + \\frac{x^{7}}{5040} + \\frac{x^{8}}{40320} + \\frac{x^{9}}{362880} + \\mathcal{O}\\left(x^{10}\\right)$$"
],
"text/plain": [
" 2 3 4 5 6 7 8 9 \n",
" x x x x x x x x ⎛ 10⎞\n",
"1 + x + ── + ── + ── + ─── + ─── + ──── + ───── + ────── + O⎝x ⎠\n",
" 2 6 24 120 720 5040 40320 362880 "
]
},
"execution_count": 62,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Indicando el número de términos\n",
"series(expr, n=10)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Si nos molesta el $\\mathcal{O}(x^{10})$ lo podemos quitar con `removeO()`:"
]
},
{
"cell_type": "code",
"execution_count": 63,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAjgAAAAwBAMAAADulx2BAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEHarIkSJZt3NVLsy\n",
"me8Q6PJIAAAItklEQVRoBe1abYxcVRl+7ux87Mzs7NwupAGNzHRLNtFk6UoxVULdMUHRkLITEyRK\n",
"cIfVbMWy9kYNlR9lN1hNsGqnJqiLkg4oIbGSHRSNEXXHYBrQmB1TWWKWtdtIo3wEukDZdqkd3/tx\n",
"7s7cc957bsM/M/fPPed9Ps573zlz7icQ3DKLlWCI7d81bLLYBvDFTZs2OspWcsJSxt3gU3/aF4Jm\n",
"GSw59H4OWfobg2jDWzGs5XiEVMOoR+COtloa2v3xlRCf8dZICDpnqsHnsKQG8Hl8iEG04TMYY4aT\n",
"pNkSqlJQDnzg5lvDHWMjRlGW+ZHP/NFvyg1jL+O9iGmZ7UQOYKHEQJpw/DzyZQ1HwLlvx0dEO2Rf\n",
"wyMhKEH9tVD85jA0VmCKA/yD0Z3CWNQjDDgYVJxaIMZ1jUOLHNQRNyodXamTfzh07bptMGSN+DNb\n",
"HOMVaSAR4P6KAmf3L2HBYsEAcPfZUiCi7PawP65LH2smZpRCN3gpjvJohSuO8d4iq7qXRTTAUW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mwGfzPbto/8qOgjN3HkLjyFe\n",
"UhFB6Z0wbeRdG5KAGVCguvAWTnHspKiGKXkVtZGfbN9+4WrJFqCzFTNzbJVCoA7119H7Jl1F5Fbs\n",
"C/Er+0vAE3gByJauUn/mTAIHeRk4VKIbg5ia2ATuc4k0HT2JlMECsXgLpzh2UrEV5KqS2EYoSHnI\n",
"2xytOXLUjngqNRiMpizMFfFrXFGLf3Py+EziMFJFfNrEl9FbU37mnKdq2sg+ZF7HxyenPqgm7kLq\n",
"BYEISXBszFFxeAu7OE5S+BauaATFLgK8HQTsfrZiqM9WQqUSKWK3Lf+K7tOWr0Oa7nRm8NQiXfH0\n",
"7ZyiG8+JrQ2Zn5x/w3KQxPJSGUdarbNqYnxxJ90ZORa+RHK7qYYQi+Ovfd1yk9o8eJ2kdRHsae2Q\n",
"IApMHW+owt5BKqFu8KIq8D/jPHYWGoQJ2wAAAABJRU5ErkJggg==\n"
],
"text/latex": [
"$$\\frac{x^{9}}{362880} + \\frac{x^{8}}{40320} + \\frac{x^{7}}{5040} + \\frac{x^{6}}{720} + \\frac{x^{5}}{120} + \\frac{x^{4}}{24} + \\frac{x^{3}}{6} + \\frac{x^{2}}{2} + x + 1$$"
],
"text/plain": [
" 9 8 7 6 5 4 3 2 \n",
" x x x x x x x x \n",
"────── + ───── + ──── + ─── + ─── + ── + ── + ── + x + 1\n",
"362880 40320 5040 720 120 24 6 2 "
]
},
"execution_count": 63,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"series(expr, n=10).removeO()"
]
},
{
"cell_type": "code",
"execution_count": 64,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAA9EAAAAwBAMAAADk7uT6AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEHarIkSJZt3NVLsy\n",
"me8Q6PJIAAAOX0lEQV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rt{3}}{1440} \\left(x - \\frac{\\pi}{3}\\right)^{6} + \\frac{1}{240} \\left(x - \\frac{\\pi}{3}\\right)^{5} + \\frac{\\sqrt{3}}{48} \\left(x - \\frac{\\pi}{3}\\right)^{4} - \\frac{1}{12} \\left(x - \\frac{\\pi}{3}\\right)^{3} - \\frac{\\sqrt{3}}{4} \\left(x - \\frac{\\pi}{3}\\right)^{2} - \\frac{\\pi}{6} + \\frac{\\sqrt{3}}{2}$$"
],
"text/plain": [
" 7 6 5 4 3 \n",
" ⎛ π⎞ ___ ⎛ π⎞ ⎛ π⎞ ___ ⎛ π⎞ ⎛ π⎞ ___ ⎛\n",
" ⎜x - ─⎟ ╲╱ 3 ⋅⎜x - ─⎟ ⎜x - ─⎟ ╲╱ 3 ⋅⎜x - ─⎟ ⎜x - ─⎟ ╲╱ 3 ⋅⎜\n",
"x ⎝ 3⎠ ⎝ 3⎠ ⎝ 3⎠ ⎝ 3⎠ ⎝ 3⎠ ⎝\n",
"─ - ──────── - ────────────── + ──────── + ────────────── - ──────── - ───────\n",
"2 10080 1440 240 48 12 4\n",
"\n",
" 2 \n",
" π⎞ \n",
"x - ─⎟ ___\n",
" 3⎠ π ╲╱ 3 \n",
"─────── - ─ + ─────\n",
" 6 2 "
]
},
"execution_count": 64,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"series(sin(x), n=8, x0=pi/3).removeO().subs(x, x-pi/3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Resolución de ecuaciones"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Como se ha mencionado anteriormente las ecuaciones no se pueden crear con el `=`"
]
},
{
"cell_type": "code",
"execution_count": 65,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAGEAAAAUBAMAAABvx07iAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEHarIkSJZt3NVLsy\n",
"me8Q6PJIAAABM0lEQVQoFWNggIDcvQJQFpEUmwPzBCKVQpVxOPB8IU0HXwDLV9J0MDBwfSRVB4cC\n",
"qTpyidDAkpa9AK6M/QKciZvhy8D1HS4bxhADZ+Nk6C9g+AGT5Jm1aiOMjZuOC2D8CZPl+///A4yN\n",
"jwa7SkjZVU0BUxWjkklQEoYwJ9C7jAnsTRxYUogYQ4VCJ0hH5kwQmAvWfKwXSLEJsH3kcgDzUYhE\n",
"hnyBJSgiIA7bG6AdDJwb4BKMMzqAoPMAUECAYTZcGInxTgDI4VdAEkFifkJiQ5guDAz7FwCZ5w8A\n",
"DcQEPH+A9gNBBsjajmYQ878Aw/4CBi4BfQYmLDoWMn1gUAQpQwKvGRj6HRjiF+xncEcShTJZf3F/\n",
"YClAEy9n4AI6VVhJKB1dBqiQ0UhRrRxNAwPr3dsBDAAbFkHpklxB3gAAAABJRU5ErkJggg==\n"
],
"text/latex": [
"$$x^{2} - x = 3$$"
],
"text/plain": [
" 2 \n",
"x - x = 3"
]
},
"execution_count": 65,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#creamos la ecuación\n",
"ecuacion = Eq(x ** 2 - x, 3)\n",
"ecuacion"
]
},
{
"cell_type": "code",
"execution_count": 66,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAIMAAAAUBAMAAABc0JOuAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEHarIkSJZt3NVLsy\n",
"me8Q6PJIAAABYklEQVQ4EWNggIDcvQJQFrkUmwPzBHL1QvVxOPB8odAIvgCWrxQawcDA9ZFiIzgU\n",
"KDYil6AJLGnZC9AUMV7TPQAXYr8AZ+Ji+DJwfUeT41zA2AIXCmOIgbNxMPQXMPxAk6pjYMiECfHM\n",
"WrURxsZFxwUw/kST28zAsB6WJPn+//+AJo2Fi+GRzwwM8QsYGISUXdUUMNVjE+ZECzDGv0AjFBgY\n",
"E9ibOCZgGIFN+FgvWBnbTDAAGsfyjYHhfAIDmwDbRy4HDCOwCrO9QVUHNYKRgXMDXEKyAwTmAPlw\n",
"YYQQUPSdAFwpiMEIdAXQIwwM/CACE2AIuzAw7F+Aqg4YFutBQucPMKAaDlGGIfxfgGF/AVCODezU\n",
"DgMgs5uBoV6AgUtAn4EJ0wgswq8ZGPodIMbDSD0GhpugeN3P4A4TQtBYhMsZuD4hFIBZHAsYgSEs\n",
"rCSUDnIeGsAizHr3dgCaKsYk5QMMAA6TWMccHnwHAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$x^{2} - x - 3 = 0$$"
],
"text/plain": [
" 2 \n",
"x - x - 3 = 0"
]
},
"execution_count": 66,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# También la podemos crear como\n",
"Eq(x ** 2 - x -3)"
]
},
{
"cell_type": "code",
"execution_count": 67,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAMoAAAAmBAMAAAB3zRliAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEO+Zu3ZEIjKr3VSJ\n",
"zWbLFm07AAACl0lEQVRIDeWVv2sUURDH57Kyt95d1uNALPNDsBOj2Gh1YuxT2NlcFS2CLii2Hqil\n",
"aCOCIARBBEEUMY0pPAhBUggHYhNdPPAfyDURETx335t5+2bv/UiQa3SLezPz/c58bt9jd6E1fxQm\n",
"e52an4PWZBFi+v9EGeG1495Xj82zY2HPPR1Vnw0pUds87UAzVza3mmaZqnbbHWGRlOjMKjXwdS1X\n",
"gkHQ5uVyZrXdfiyseC/11XKjzPuQKUEv9hyL3fZuD5R4kFMAgr6EWn4dtr1QpkFSWl3LfFl22HyU\n",
"6muAS5Jy+LMd4rH5KCtDqLTxXhyn77H5KPAVgg5Sol9gvdw2C+WIGneteSOLs9Nvdau/VXUsMNkq\n",
"Cdk4ZZbKaxTAdO9RFtdnoZbEc6o6Fphs9SWyvRGBfF6qZ39SvaCEuw8AciXa3FL/jbqL1WRTlOuv\n",
"HuZOfCqLpoIC3xyziwaTTVHQ5qLc1UY5QoNtPxTHZI9kpuSfhx3ZSTt2iD4ZuPK5le0X2fWyC2Yb\n",
"UYSadfId+5imT9P0E5+436yRptvH03RB60PKxvkmFuleMC0ErWksbJw+yWp0L4CCpDSSg320cYom\n",
"sDGl5AM8YRVFQUFSakn0w0jRhBn6H2yeTJ7D/UQvKwoKkjLVqe4aKZpQG+pzeHwMbnX0iqKggOcC\n",
"dZrBdyx7w5AAl/U55fg9nasQFAVACESpLWHf1VK/EmBQUlj6jGVh4RUCUTaYS0uUUCk6NRnDxsJ4\n",
"TVSkgJTY5iqE2DJHlL/bRCkgZQWumH1WgdnDXthlBUpQkJToy/o5EthqFZgL7q2/ZaevVBQkZUq9\n",
"xpQuA6vAfSdGI16gDAXcMapOaP23KDOLFya0TzT24uIQwmXnq4Osf7HeXO78ATCf68GPK8b6AAAA\n",
"AElFTkSuQmCC\n"
],
"text/latex": [
"$$\\begin{bmatrix}\\frac{1}{2} + \\frac{\\sqrt{13}}{2}, & - \\frac{\\sqrt{13}}{2} + \\frac{1}{2}\\end{bmatrix}$$"
],
"text/plain": [
"⎡ ____ ____ ⎤\n",
"⎢1 ╲╱ 13 ╲╱ 13 1⎥\n",
"⎢─ + ──────, - ────── + ─⎥\n",
"⎣2 2 2 2⎦"
]
},
"execution_count": 67,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#la resolvemos\n",
"solve(ecuacion)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Pero la gracia es resolver con símbolos, ¿no?\n",
"$$a e^{\\frac{x}{t}} = C$$"
]
},
{
"cell_type": "code",
"execution_count": 68,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAE8AAAATBAMAAAAjVk05AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIquJdjLdEETvu2aZ\n",
"VM0GsGrEAAABKUlEQVQoFWNgQAIiJpuQeHiYF7qY8cgiS7kgc/CwDVbw4pFFktJ2dkXikcxk91LS\n",
"ZjRA1sb/HwiQBSBszw0MvCc3YIqji1SlA0XOC6AKMyqg8kG89wVAohNNnNsBTYCBgecvSCgGiBmV\n",
"XYGGF7scBLLNToNEUYB8AohbCsSdAlwfGDgSGYSBbDaQIBDYvQOBNyCmvQOIBAL22Qw8CxgkL7Af\n",
"BXLqwEIoRH4AlMvznYHNgUFzizfIzXe4URSBOPPBIkBJzgUM9QEMnyAKhBwhNBKZD2LzAo2tN2C4\n",
"z1DwGUkKyDRLA4EkkCA4BHmAjPoLDOt4BSYzMLCAhDGBvAFQzByI+Ry4k5gZ/BjYQcGDBfD+Bjod\n",
"5H52FVMhDwaWI7uxKAIL1SzSaQAyAPt1PB+SzWHeAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$a e^{\\frac{x}{t}} = C$$"
],
"text/plain": [
" x \n",
" ─ \n",
" t \n",
"a⋅ℯ = C"
]
},
"execution_count": 68,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Creamos los símbolos y la ecuación\n",
"a, x, t, C = symbols('a, x, t, C', real=True)\n",
"ecuacion = Eq(a * exp(x/t), C)\n",
"ecuacion"
]
},
{
"cell_type": "code",
"execution_count": 69,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAFgAAAAbBAMAAAAKd1XFAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAu90iEFSZzYlEq3Yy\n",
"72ZZXIwmAAACH0lEQVQ4EX2UP2gTYRjGn+Qul15yiVFwCQghOhQtJR10cOlRRASHxMVFoTcIFgfp\n",
"4KCLZooVHTo7aFUQpA5xkUKWuFYlXQQFhwpOulj8g4VIfJ7vLtc0IXnh3vd5n/vd+335kgswOfLF\n",
"pfOVGDlU3tOxaYS3Cli3YR8BmjTc8jRK+4mB7g11hw98AR4a+/QE+AaJj7zeAlPboifADtfO/iJz\n",
"htex/fDmTfUDMe8DyUJkvFYNJy9UAPt45PdLg+JAEHXzqiG8KFlUGogP1Mk6D2RbQimEr1INw562\n",
"63Abjh+JCJ5mOwznt2TOwn6gmlWnye6TnXVKbuNc6x7PtPH9FVtnmQlTz+/7qq7WMdtI/VBfhHcU\n",
"iSbt2SzbREFmP7wulYHDIUV9HK+bKeGpkPSacj+sXSoD6zNrcqcG/HW2QjgZ0OuZ4MLWb3YGrq5S\n",
"EV5k3bG6tg5t7OTHsA2syX+sjY32KOz9pGcm38VlA+cCuLspswyQKeiRfuydxjW7SfMgvM9I191b\n",
"7ypCzMn2WZhTN5PnWjQ3e89wauUFcKf3L2BvZsWwvspwG7ElkajZJ09IfFLC2dZLlbTWNpPVxXGB\n",
"iu8GsKRkz5jfCKo+m1F4oQ0c5h28V3ICr6T6TWkUtldajbZuZWpMuVp2Tc2M0igs14S9zFKtJL76\n",
"QL4uawKMi7yfa3cescyJJVwe+7+R4j7c9UvXiV3h5ZaHXzwNGB//AaBTdqtvvq+XAAAAAElFTkSu\n",
"QmCC\n"
],
"text/latex": [
"$$\\begin{bmatrix}t \\log{\\left (\\frac{C}{a} \\right )}\\end{bmatrix}$$"
],
"text/plain": [
"⎡ ⎛C⎞⎤\n",
"⎢t⋅log⎜─⎟⎥\n",
"⎣ ⎝a⎠⎦"
]
},
"execution_count": 69,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# La resolvemos\n",
"solve(ecuacion ,x)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Si consultamos la ayuda, vemos que las posibilidades y el número de parámetros son muchos, no vamos a entrar ahora en ellos, pero ¿se ve la potencia?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Ecuaciones diferenciales"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Tratemos de resolver, por ejemplo:\n",
"\n",
"$$y{\\left (x \\right )} + \\frac{d}{d x} y{\\left (x \\right )} + \\frac{d^{2}}{d x^{2}} y{\\left (x \\right )} = \\cos{\\left (x \\right )}$$"
]
},
{
"cell_type": "code",
"execution_count": 70,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAT0AAAAvBAMAAABj3ACKAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEImZdiLvVM27RDKr\n",
"Zt3KPpNmAAAEy0lEQVRYCb2YXYgbVRTH/zO7+d4kw1qKDwuNbkSQFoNWWPGh03QRH5TOU0VR2EVL\n",
"VRAi+PGmUYSuPmjE9UGoNEhBRHDzoH0QdBepIPgSEEEQ21Aq+lRTP1hQZD33ztzJfCW5Z7PZ+zD3\n",
"zL2/859/7syQOweYVlt815qW9F7oms5ccy90pqVRcgp/T0t7L3TT7dQ/e6EzPY3Mjelpx5U/fiI+\n",
"NnxE0CV7+PwUZrZZmkQvshImhfOsu0V0sTbpJVn5Zo+DE/0hPuFkTMpmWcuRrRXOvvTOpNfUz3+s\n",
"utng0emdnb5+xoRk/jTOW9oaPFpbdgR4sIulEdORKR4dSd7V6TELV/UTebS+7nDyaRiMPysePfyq\n",
"2jPGH8j0DV2cR+uqjuKMbeSaL4wignM8Opi56/h1XN6qaGfzaE3ZLz3upyR+of75pXZwgkeLzELX\n",
"z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qhsVvkLobKR6iJQnsvjibT7is9GRAL0/JSxZTlGbj6ib2HmA3qcS\n",
"liynqM1HzE90IEDvUwlLllPU5iNqJ3bOo2PpuxjwyillWyuXR2tJjoZUOcXdfIxmaZPnlWr06HFq\n",
"OvNuOUVtPsZl8OhxalrzspyiNh9jM3j0WDkNQBZf1OZjLM+jx8r9DyA4hgIsR34fAAAAAElFTkSu\n",
"QmCC\n"
],
"text/latex": [
"$$y{\\left (x \\right )} + \\frac{d}{d x} y{\\left (x \\right )} + \\frac{d^{2}}{d x^{2}} y{\\left (x \\right )} = \\cos{\\left (x \\right )}$$"
],
"text/plain": [
" 2 \n",
" d d \n",
"y(x) + ──(y(x)) + ───(y(x)) = cos(x)\n",
" dx 2 \n",
" dx "
]
},
"execution_count": 70,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x = symbols('x')\n",
"f = Function('y')\n",
"ecuacion_dif = Eq(y(x).diff(x,2) + y(x).diff(x) + y(x), cos(x))\n",
"ecuacion_dif"
]
},
{
"cell_type": "code",
"execution_count": 71,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAgkAAAA/BAMAAACY8EZSAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEImZdiLvVM27RDKr\n",
"Zt3KPpNmAAAMGUlEQVR4AaVaa4xcVR3/39m5O7Mzu7OT0pAQmu5QykNju6MFoZbYaV0RE8iOaKto\n",
"cBeRiiB2tT5CTNhRYl2+sPuhijWNOwFTE7/sRJtKFN0lVGKkdSdYPxnogG1ijHG3lIeFyvo/r3se\n",
"95z78iRzz/91fr9z/vfce869dwD+vzLUSND+tD2mVLfbY60u0qd4y8zAscyOgEccdtVc6KmaIh9S\n",
"5DSii3SgwVGyAqfphBLrP6goLnFvx+G5vO1wRJudpN4DvGFG4Ghat7fScPsCz9lAM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V9Vgt\n",
"RGoAznKE1MCxzL/ACPKpde+Ut8M78eRYlbVIlG5xbjhJfokLvAo+uOlmt2aSmoBizUkN7KZknvz9\n",
"WI/h7/nTd/AEUIf2JxIWGj7iY4FaDpDvtUpZrCtKEtEkNQDL9PkbgVIDx5F/YrzN/oFh3Ol8Q7fi\n",
"TCyp5nId8loW8M9Z6YpBagLiv8dYSQ0c2w38k8FQDaPMVQ+3LLGlv6eGfH7T1X9WdVjWtCSKTmoC\n",
"Dq5yjPTAceT45oN+av0CfjhSY0e106p6pJwjrzqDMru2Ji5cZiMXW7qik5qA/S2Olh44rhv+BfoP\n",
"DLgNPFwpZZmoSdkl0bcmLieUxMdcZ0TIEU260GANMgCHmEzDcvUVYsrfQF5AyFLsSdkpPe70oGNQ\n",
"f+SMChW+aNLlKovLACwInPXidXWbbyjJludMx9aU24atuBEN8I1gJKlYIjIAR7ISZ/F+nmIj0rxd\n",
"Gm6qDtdsVm6LTJGjXRRpkKIswA6+wBz8IyWwMGHUnhwtKvibumblyozNGGOLIiVva2nJAsybuqvv\n",
"2139Nbtds+LK4iqlyNntaBVFusAvv0zADr5Y81CSm9sZ94Qp1mMpwgFRpI/y8EzAYaqEllcTxFVq\n",
"ziDy4SV9cZMWxFnJBpy+K6wF+ZYYV8ravkmLfkjTkipu0v4ux8gGnLQDZtxQz7RY9JctNmoaXHJ5\n",
"Iu1u0pO8XUbgSNYo53NRTtEn19X/SILGthAXaaHHo7MC28iS2IpTCaJ+YI/x77PbY60u0r38+swM\n",
"HMvsCAj+euPwU/OVdqf+psEeY7W6SPfw6NTA/wO4IFF6BGvVMQAAAABJRU5ErkJggg==\n"
],
"text/latex": [
"$$y{\\left (x \\right )} = \\frac{1}{\\sqrt{e^{x}}} \\left(C_{1} \\sin{\\left (\\frac{\\sqrt{3} x}{2} \\right )} + C_{2} \\cos{\\left (\\frac{\\sqrt{3} x}{2} \\right )}\\right) + \\sin{\\left (x \\right )}$$"
],
"text/plain": [
" ⎛ ___ ⎞ ⎛ ___ ⎞ \n",
" ⎜╲╱ 3 ⋅x⎟ ⎜╲╱ 3 ⋅x⎟ \n",
" C₁⋅sin⎜───────⎟ + C₂⋅cos⎜───────⎟ \n",
" ⎝ 2 ⎠ ⎝ 2 ⎠ \n",
"y(x) = ───────────────────────────────── + sin(x)\n",
" ____ \n",
" ╱ x \n",
" ╲╱ ℯ "
]
},
"execution_count": 71,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#resolvemos\n",
"dsolve(ecuacion_dif, f(x))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Matrices"
]
},
{
"cell_type": "code",
"execution_count": 72,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAADcAAAAyBAMAAAAKOF7GAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMA74lUMhAiq3bdRLtm\n",
"mc0lg57xAAABSUlEQVQ4Ee3UPUsDMRwG8OdSr9DT1oIuouANDgoO9w0qWPdzFrlu7rp0cOhQEARB\n",
"EHHVT2D9AIqjo4Pgpi7iVBGlDlI4E/LSZ7hmdjDLJfnxz11yD8Fi/omiJvK8jpnmRpEhbK7XMVtI\n",
"anKiGLfmPIg3H355MBp4UBwTlne7p2poW619lLivvWhNflhQz+wV3xbDBVR7jI0U8tj0PqsDVDqM\n",
"TwgdBj1ka4x9RHIzujKL0UBKOoRczGKCm1KL8AebtxZrnakzQYZ9XMuhXjZsL+0cMm4fyEKDPE99\n",
"XUkT3P1HeRpjDyG6uh+PmE48eJl6cMXzTvRHKJa7/LNkyF3AUD7BO6MMuQsYghh7hCrkL27ZZ84l\n",
"VC4rscN5KpPdQIb83KLKPjcTcnN8Q6BEmumQG3xE+EBoQm5QrN6RwYTcIMuo/xfRe6X6LuNfjWlM\n",
"FpMM9N8AAAAASUVORK5CYII=\n"
],
"text/latex": [
"$$\\left[\\begin{matrix}a & b\\\\c & d\\end{matrix}\\right]$$"
],
"text/plain": [
"⎡a b⎤\n",
"⎢ ⎥\n",
"⎣c d⎦"
]
},
"execution_count": 72,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#creamos una matriz llena de símbolos\n",
"a, b, c, d = symbols('a b c d')\n",
"A = Matrix([\n",
" [a, b],\n",
" [c, d]\n",
" ])\n",
"A"
]
},
{
"cell_type": "code",
"execution_count": 73,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAqEAAAAbBAMAAAC+QktXAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMolUmc0idhCru+9m\n",
"3URozekSAAAFmklEQVRoBeVYTYgcRRR+07M72zv/h+hBlIy6GggKA4kGFdkWFU0QdiEOJjEhfVBI\n",
"RNmNlz0o0kg0xiATFRmDG13QgBjBIMTD+pNBBL0EN/gTo0hGD14MbNygLNE4vvp5VdXdlUnYkJ4G\n",
"69D9+vveq/ne1zXTPQXQa4xVo+xVUSAl16lSmrn+vK40o8yy/QYy0b1Mw/iMiw1TobR8l5B7r39e\n",
"2bfEmDsN5E0Rj7wTGOClhs66+5cyRTqUPjrDtA8tsqN9jMRgw9HcOGcdf1gEsdwlATfCa0upS4nS\n",
"D5l24cfOqZdjjeycWh/DDEcH6pwt+Zm/YmlLB76H5X7P6lQrPcCkc0fdY5nYUrVhYDj6kmi80Mn9\n",
"G7Ygd897+olWPuiFWVgG7sG5CCYvMfkzmOgY5AYj5qFNlQ3rj1L+/eKODniZWJOIHYr2Y+q8m8hs\n",
"5GbsBsfwuFKnPHn+EWBwbwSjS5Y8GtAVwGORqQHSrVQ7WqgPqSaflw2ZmOpRr1F3jsDSJEXi/DrA\n",
"xxqZD3hMs8LQLEDYZUUBsOTjuvbFtTFHTVVU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eN42/Mzd9KUslZSQj\n",
"wd9HB944Nw2l8D/R3kqVo/1QGnLU2KBQvbO3nNgYDRj08IYYcQFAzxpL7EHx3N8iFUICgrpQKVWO\n",
"UkOJKjXXqLFBcUo1UJpUoQqO82jUU8BFBnrWWEEPiue2IxVCAoK6UCkt6+Q+KA056ngoMTKiWyBI\n",
"Ox4ecDvO56dEDm47/DGOF75mV+lQGv7WhzYohOSiJ87m0ZJm0pcjLkYmtUhIiVIAvofvHGKKaYPC\n",
"VG/ZArGlmSUJxDYJqVH6LTdgY4AnuUFhOmLbArGkmSVJxBYJqVE6jP97cGTfxsMR9WeZY+xg2wKx\n",
"pKn8hAKLhLQoLb+fkAf/r4/5D7YKDmxJvOctAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$\\begin{Bmatrix}\\frac{a}{2} + \\frac{d}{2} - \\frac{1}{2} \\sqrt{a^{2} - 2 a d + 4 b c + d^{2}} : 1, & \\frac{a}{2} + \\frac{d}{2} + \\frac{1}{2} \\sqrt{a^{2} - 2 a d + 4 b c + d^{2}} : 1\\end{Bmatrix}$$"
],
"text/plain": [
"⎧ _________________________ _________________________\n",
"⎪ ╱ 2 2 ╱ 2 2 \n",
"⎨a d ╲╱ a - 2⋅a⋅d + 4⋅b⋅c + d a d ╲╱ a - 2⋅a⋅d + 4⋅b⋅c + d \n",
"⎪─ + ─ - ────────────────────────────: 1, ─ + ─ + ────────────────────────────\n",
"⎩2 2 2 2 2 2 \n",
"\n",
" ⎫\n",
" ⎪\n",
" ⎬\n",
": 1⎪\n",
" ⎭"
]
},
"execution_count": 73,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#sacamos autovalores\n",
"A.eigenvals()"
]
},
{
"cell_type": "code",
"execution_count": 74,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAPAAAABLCAMAAAB5hvoWAAAAPFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAA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44xA23+a4/nYrp7HjhJNvHFwTqt44UKsr\n",
"0hWE4xcA1KaqNw5UWUW6gvCVbxwqGJKqNYSJqp+R3AirrS96RPUzbC+10vxwySB/0KPr9IvnUjU/\n",
"p7z64RL4VYJ/AVGSU5rI8CpmAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$\\left[\\begin{matrix}\\frac{1}{a} + \\frac{b c}{a^{2} \\left(d - \\frac{b c}{a}\\right)} & - \\frac{b}{a \\left(d - \\frac{b c}{a}\\right)}\\\\- \\frac{c}{a \\left(d - \\frac{b c}{a}\\right)} & \\frac{1}{d - \\frac{b c}{a}}\\end{matrix}\\right]$$"
],
"text/plain": [
"⎡1 b⋅c -b ⎤\n",
"⎢─ + ──────────── ───────────⎥\n",
"⎢a 2 ⎛ b⋅c⎞ ⎛ b⋅c⎞⎥\n",
"⎢ a ⋅⎜d - ───⎟ a⋅⎜d - ───⎟⎥\n",
"⎢ ⎝ a ⎠ ⎝ a ⎠⎥\n",
"⎢ ⎥\n",
"⎢ -c 1 ⎥\n",
"⎢ ─────────── ─────── ⎥\n",
"⎢ ⎛ b⋅c⎞ b⋅c ⎥\n",
"⎢ a⋅⎜d - ───⎟ d - ─── ⎥\n",
"⎣ ⎝ a ⎠ a ⎦"
]
},
"execution_count": 74,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#inversa\n",
"A.inv()"
]
},
{
"cell_type": "code",
"execution_count": 75,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": [
"iVBORw0KGgoAAAANSUhEUgAAAKMAAAAzBAMAAAAJJKXwAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\n",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMA74lUMhAiq3bdRLtm\n",
"mc0lg57xAAADxklEQVRYCe2XTUhUURTHzzx9iqOOUhGUlUNEGGQMSBG0UMiCNjkuqkXIzE5aJbVx\n",
"ETGEUARBH/SxtGhXkC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g5Gm358TS4JxeTaGyag4rgFcuxBmkiuI\n",
"Ik2/X8XWyFFJJFdwNOYawLULijSAKJKb+lfwPztI4wpirsG4gtAuCFJcganmD85N3Tv8non6wY0r\n",
"iLkGdgXWLghSXEEEKSR7k0S7XntSJZN3GS+p7PfxDF1XyayO1IJN3f9lpP3zvKmTixeZP8/2L35c\n",
"3dSa/uL/AbUnIQ4mI31BAAAAAElFTkSuQmCC\n"
],
"text/latex": [
"$$\\left[\\begin{matrix}a^{2} + b c & a b + b d\\\\a c + c d & b c + d^{2}\\end{matrix}\\right]$$"
],
"text/plain": [
"⎡ 2 ⎤\n",
"⎢a + b⋅c a⋅b + b⋅d⎥\n",
"⎢ ⎥\n",
"⎢ 2 ⎥\n",
"⎣a⋅c + c⋅d b⋅c + d ⎦"
]
},
"execution_count": 75,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#elevamos al cuadrado la matriz\n",
"A ** 2"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"_ Esto ha sido un rápido recorrido por algunas de las posibilidades que ofrece SymPy . El cálculo simbólico es un terreno díficil y este joven paquete avanza a pasos agigantados gracias a un grupo de desarrolladores siempre dispuestos a mejorar y escuchar sugerencias. Sus posibilidades no acaban aquí. En la siguiente clase presentaremos el paquete `mechanics`, pero además cuenta con herramientas para geometría, mecánica cuántica, teoría de números, combinatoria... Puedes echar un ojo [aquí](http://docs.sympy.org/latest/modules/index.html). _"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Si te ha gustado esta clase:\n",
"\n",
"\n",
"\n",
"\n",
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### ¡Síguenos en Twitter!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"###### "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### Curso AeroPython por Juan Luis Cano Rodriguez y Alejandro Sáez Mollejo se distribuye bajo una Licencia Creative Commons Atribución 4.0 Internacional ."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"_Las siguientes celdas contienen configuración del Notebook_\n",
"\n",
"_Para visualizar y utlizar los enlaces a Twitter el notebook debe ejecutarse como [seguro](http://ipython.org/ipython-doc/dev/notebook/security.html)_\n",
"\n",
" File > Trusted Notebook"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%html\n",
"\n",
""
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
" \n",
"\n",
"El estilo se ha aplicado =)\n",
"\n",
"\n",
"\n"
],
"text/plain": [
""
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Esta celda da el estilo al notebook\n",
"from IPython.core.display import HTML\n",
"css_file = '../styles/aeropython.css'\n",
"HTML(open(css_file, \"r\").read())"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"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.4.3"
}
},
"nbformat": 4,
"nbformat_minor": 0
}