Last active
February 26, 2020 08:41
-
-
Save DBremen/f2dc2b21afb8fd62f67b26a55e7a0514 to your computer and use it in GitHub Desktop.
smypy solve algebra
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "import sympy as sym\nimport numpy as np\nsym.init_printing()\nfrom IPython.display import display,Math", | |
"execution_count": 1, | |
"outputs": [] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "x,y = sym.symbols('x,y')", | |
"execution_count": 2, | |
"outputs": [] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "#exp = 2*x + 4 = 9\n#change to homegeneous form\nexp = 2 * x + 4 - 9 # \"= 0\" part is left out\ndisplay(sym.solve(exp))\nexp.subs(x,sym.solve(exp)[0])", | |
"execution_count": 12, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "[5/2]", | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAADAAAAAVCAYAAAAAY20CAAAABHNCSVQICAgIfAhkiAAAAmNJREFUSInt102IjVEYB/BfZmJqFgrFQsZESUgWFjZcLJB8RDZSFuyU7NgoYyGLKZJCKYqdMkmRDddHdko+YqFx2RiiTBjkYyzOuXnnOu+971y3SP51Ovec5znP+T/3fT7el38IJQxnxuM/ymYkJhnJbbgqGJNQvo4eHK3ZrySMVMdAAwKT8Q1H4noitqMPT/ARg7iFbQleQ5FTD55lBe2Jy8rYl0NkEIcT++/r87cukuqL6004hhe4hueCkxtwEquiTvWfHspwKqErdUkpHsgjX4mjGVzGa7TF9TKs8es/PUVwZhgbc2yVNQihVmO8QPiiEEZwNa6/1+gO4Hj8XSpiPBVC9TAOWzANH3APNzLEUliNsThf8I4vcf46Sm6FQiiVwP1YUsfuOSFHOgpwaMf9aHdFjk5ZkyF0CsuFOO3EPJzAdCHG5yfOdGBllH8qcMdBzMUlXBkFNzR+Annojef6ErK1Uba5gJ2dUfcRJtTRK8s8gSxKmnNgZjz3JiE7hc9CItfDjmjjofCE66GsxVXoVZw7a/bbhFJ5VegfedglNM0HWKpxUxyBVjiwKM79NfuLhY6bCq0qduMQ7grkX9XRTaKoA3Ok47LLz1eOszWyDUKdv5Bjc6+QtHeE4vC6IJcRKNoHNmGP0Paf4h1mCDW+Q6gavTVn1uM2XibsbcV+oX/cFBK4FhWcbkSsqAPXMAsLhJDpxFvh5etMHNnKsBBThfBIoTvObUIOpHBdAQeyKGmuCqVwINrqbqTYBMoalNFWfA88EhKzVcj9HsiGUEV4366iqaSKmP0bZ1Oofg/8x1+HH4+Zn7lAYI4wAAAAAElFTkSuQmCC\n", | |
"text/latex": "$\\displaystyle \\left[ \\frac{5}{2}\\right]$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "execute_result", | |
"execution_count": 12, | |
"data": { | |
"text/plain": "0", | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAABHNCSVQICAgIfAhkiAAAAM5JREFUOI3N0rEyQ0EUxvEfJcMVWhoZ8Qpq75PnoDJ0Kl5BK0U67yAUiUYmpZGYoRDNuePOkXszYxS+5ps95/x3Z3c//lC7uMIz3jHCOVpNUBsTzHGDU/RjfY+dOvA2hrqpfhb1y0XQfjSHWE29DUwxw7o0cBzew2cCX3GHNRxl8DD8oeYaj+GdDBbhLzVgWd/K4DKthM8zWO5YWKzN6lwVHIR3asCD8B9v0Lb8O97Ed2T9KgDlqdXInfiO3EBD5GAP1xjjA0+4wHYT9I/1BRgnMa7SDNsAAAAAAElFTkSuQmCC\n", | |
"text/latex": "$\\displaystyle 0$" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "display(Math('\\\\text{The solution is } %s \\\\text{ is x = } %g' %(sym.latex(exp),sym.solve(exp)[0])))", | |
"execution_count": 15, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle \\text{The solution is } 2 x - 5 \\text{ is x=} 2.5$" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "def solveAlgebra(expression,variables=['x']):\n text = '\\\\text{The solution to } %s \\\\text{ is: }'\n substitutions = [sym.latex(expression)]\n #display(Math(text %(substitution)))\n i = 0\n for variable in variables:\n solutions = sym.solve(expression,variable)\n j = 0\n prefix = ''\n newText = '%s \\\\text{ = } %s'\n if j > 0:\n prefix = '\\\\text{; }'\n for solution in solutions:\n if j > 0:\n prefix = '\\\\text{, }'\n text += (prefix + newText)\n substitutions.append(variables[i])\n substitutions.append(sym.latex(solution))\n j = j + 1\n i = i + 1\n display(Math(text % tuple(substitutions)))", | |
"execution_count": 98, | |
"outputs": [] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "## Convert expression to homegeneous form for solve function\n\n- 3*q+4/q+3 = 5*q + 1/q + 1\n- 3*q+4/q+3 - (5*q + 1/q + 1)\n- 3*q+4/q+3 - 5*q - 1/q - 1" | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "x,y = sym.symbols('x,y')\nsolveAlgebra(2 * x + 4 - 9)\nsolveAlgebra(x**2-4)\nsolveAlgebra(x/4 - x*y + 5,['x','y'])\nq = sym.symbols('q')\n\n#3*q+4/q+3 = 5*q + 1/q + 1\n#3*q+4/q+3 - 5*q - 1/q - 1\nexpr = 3*q+4/q+3 - 5*q - 1/q - 1\ndisplay(sym.simplify(expr))\nsolveAlgebra(expr,['q'])\n\n#cancel simplifies to a single term\ndisplay(sym.cancel(2*q + 3*q**2 - 5/q - 4/q**3))\n\nexpr = (sym.sqrt(3) + sym.sqrt(15) * q) / ((sym.sqrt(2) + sym.sqrt(10) * q))\nsolveAlgebra(expr,['q'])\n#substitute q=10 and enforce evaluation of number result rather than symobls\nexpr.subs(q,10).evalf()\nsym.simplify(expr)", | |
"execution_count": 97, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle \\text{The solution to } 2 x - 5 \\text{ is: }x \\text{ = } \\frac{5}{2}$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle \\text{The solution to } x^{2} - 4 \\text{ is: }x \\text{ = } -2\\text{, }x \\text{ = } 2$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle \\text{The solution to } - x y + \\frac{x}{4} + 5 \\text{ is: }x \\text{ = } \\frac{20}{4 y - 1}y \\text{ = } \\frac{x + 20}{4 x}$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": " 3\n-2⋅q + 2 + ─\n q", | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAIoAAAAWCAYAAAAfIwRcAAAABHNCSVQICAgIfAhkiAAAA69JREFUaIHt2VuIVVUcx/GPOsQQdLeMwoeCoMKHCnoK0iwyCquht146dCMIJEzoqRqCrgZdrIgeoqIIuvlgIj0UkRVR4miCUiQORTKVVlKQXWx6+K+Dxz1nn332PlfpfGFYM+u/1tq//3/WWeu//4cRI/rMKbgV6/EN/sABfIxbMH9w0koxzH48ivfxXdL1M6Zwv9CdxyIcwtO9FtgOd2AWe/EaHsaL+DX1v4V5A1PXPsPsx1/4LOl5BOvwRdL1PRbnzLs9jbmsDxoLWY6V5n7iTse3QugNfdRTS89cVnJeL/2oqqnOeE7/g2nd53Lsm7APCyo+t6vH6AfYgH8z/TN4Pv2+LGfuGFZhOw6mOc/gWHHs7+yiziI68aPXHMzpfyO15zSxnSA2/wZx/TTSdtzHKksux9+p/aeJ7RjhxJXYIu7RhbgZZ+N4vNsHje3Qyo9BsjK1XzaxXSNi/E6mf+jiPoYd4mhc0cT+QrKtyfQvTf2zuLvCc2s6O+azFPnRDjXd0bQGk3gCm9Oa23Fqk7Fv4ndzr61exb0yj6eHbmxiuzjZ3suZuzvZl1d4bk13N0orP9qlpjuaZhz+Z86KHGRRk3Hj+E1slkY6jvt0RkDRz6sFDq1K43bh5Cb2l5P9kpz5nyf7SQXPKav7pYL1shT5MQhNxOaYwFfiLe2ijP3atPaNmf7Scc/mKLvlJ0zN2NvCdieeEgnR5eKdP8sK7McnOWuciT34pUDHkzgx03cBrhNBmc7YthWs10g7fvRbU50fRL1nK77GK1jSYJ8Qr9TZU7Bbce+Yu8SO3IHTcsaMpzFbc+xLkv3tihpqOj/m2/GjDDXdvQ4bmUprL0x/LxCvxJsy4yrFvRdVxntEkrVNFHh+zBl3KP3kVRTvS22eQ72mXT+GhTNSW38FvlTEdn1m3FDE/V6xG7do7y7fZW7FcJ4QW7+7r66opab6p7esH+1SU13TuaLol2W+wwW3xqtkndgQzZLc0nHvZh3lJjyQxG0WCWCWaUcmbY+JcvRGvC7u/ytwnMgJztf/E6WKH/3gKqzFRyKX3C82wVJR95jBbQ3jr8enIo/JMtC4TyrO7D9sMm+1SJz+TO1akQT+pHWyXERNtU/vpGp+9FITkTs8K67CfaLod0B81zPpyJOv/vq7usV6vYp7X1ms85rF/5mHRPzOKjkvN+7D+tX/hakdVCJ7tDMhKrV7Ss7LjXu/vuspS13w1EBVHL2cV3FebtxHJ8qIRkZxHzFixIgRw8J/ZshglDDDxscAAAAASUVORK5CYII=\n", | |
"text/latex": "$\\displaystyle - 2 q + 2 + \\frac{3}{q}$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle \\text{The solution to } - 2 q + 2 + \\frac{3}{q} \\text{ is: }q \\text{ = } \\frac{1}{2} - \\frac{\\sqrt{7}}{2}\\text{, }q \\text{ = } \\frac{1}{2} + \\frac{\\sqrt{7}}{2}$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": " 5 4 2 \n3⋅q + 2⋅q - 5⋅q - 4\n──────────────────────\n 3 \n q ", | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAIoAAAAsCAYAAAC6wiCXAAAABHNCSVQICAgIfAhkiAAABJNJREFUeJzt21uoFVUcx/GPxzJJU+giGUgWXiI6dsHuN7OgtKKoh4gM6iEKfEh6KqE4BGWi9WASUUSnXtIoCqoHocupByMqUimJMrSLaSZGJw0vmT38Z7fH7fbscbu3e45nfWExs2bWrPntdf7zX/818z8kEh1iA9ZgFT7qrJSGdOFzvNFpIQdhAvqwFqtxW0fVtJgNGN1pEQWZi2XKayjjcW62Pw4/4/hOCOnqxE1LwjjxhL7QaSEDsEl4EtiCP3ByJ4TkDWWumDL6s/Ipbmyiz334WLj0uw5XYB0eyfrux+94B+c00c8iPIp/WydtP3rEWOTL5sPobzqOFV6lXcwXOpcO1OgWzMZkTMET2INph3iz07LteHyD7gLX9IqBLcIK3CuMoxtviT/AiYeg8arsnjBDe6aeHnyLU3PllCb7OknEKZe1RFl9LsF64cEGNJR6bMP9ufpUfIid+AGzsAvXHuT6RbinwH16FTeUWkZjL26uOT6Q1oexUcRTm7EDLzV5/4PRg68LtGs0psfhE9zdYn15xmb3nimC58KGMhx3YreqR5iMP/EMJolpaZNwVZV5cxROyPZH40tcWOB+vZo3lPGZhstzx4porTBD+zzK38Ig1+M1TKxp00jnsOy6njboy7McC7P9PgUMpRvb8Y8InGbnzq3AqzXtX8EvufqZYlm8WjxNDxYU2qv5wViOr4RxVyiitcIM7TGUWbhdjOl1+EAYQX6KbKTzChFDrcqVIlP5oXCfeKBHZPU+BQxlhLDs6ViArSIWmCCs/Pya9i/ivSbEzRcGWSl7hPfKH7uyQD+LxOBPyh1rpdYeBwaktWVGwb5G4Tc81AadzWqdKhYEZ+WO9aljKMfU1HdjXbb/hZg25omVxV4RnOaZhvcL/5Qqz+P1XH2hcNFLcsc2NujjaczBNTnNcEELtS4V71kG4qeCfe0QAenkrN5KnTSn9VIxxeVjqeEi2H9AGPcuDjSUWrowUri/LrE8252duxoXYXGDPuqxLSsV/srq6+o3P4AluEMYydqac63UujUrrWCkeHIrb6tbPabNaH1bOIQ8L+N7PJnTtR9PCXc/UcyDC8SPmSWWvDvxrIhDbsV3wp1NOURx9ehVPEZ5TrxDmWn/pWflbXC7tRZlsfjDn4GL8W6m+/SS6aylT4MYpRc/ClezRbi/63Pn5wjXtV28u5iX7bfi7W6v4oZysPk3f307tRZlGX4VT+VGvImza9qUQWctfZp4jzIQj2NlKztsI4NFa2l1Ho7lTlP9DlF2BovW0uo8HEPpFuv6wcBg0TpYdCYSiUQikUiUgmHZdl9HVSQSg5yVql/CH+uwlkSJGZNth4vU0PM6qKWjDOXk6iL0Z9sRqvkaiURdPhNftxc2aphIjBHZaM1k+x8VDPWpp2iyeH/W7oYjqi5RCholNo9V/feKkSLn9aYjLzPRaRolNk8UScdrpOXxkKXVic1HPUM1RhkosTl95q/DUDWUfGJzhUpiczKUxP+UNbE5UULKmNicGASUNrG5DKSnp0ppE5vLQDKUKimxOZFIJBKJRCKRSCSGLP8BjZVQZx5bBq8AAAAASUVORK5CYII=\n", | |
"text/latex": "$\\displaystyle \\frac{3 q^{5} + 2 q^{4} - 5 q^{2} - 4}{q^{3}}$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle \\text{The solution to } \\frac{\\sqrt{15} q + \\sqrt{3}}{\\sqrt{10} q + \\sqrt{2}} \\text{ is: }$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "execute_result", | |
"execution_count": 97, | |
"data": { | |
"text/plain": "√6\n──\n2 ", | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAADEAAAAdCAYAAAAD8oRRAAAABHNCSVQICAgIfAhkiAAAAtRJREFUWIXt112IVVUUB/BffsSIiuVoRggiVCAK9iLkoA8qUzSSIJpELz0UUgRm9RCJgg+ioOGDow9FND44vZSJD36DjGgFKRRWSCo1KGRo4vQhaTnqw16DM3fOuefc0emGzB8OZ5/9/++119p7r73uZQj/DzxQo34s/qjj/PcES/FsPSa+l9iKB+vtRCWG1aAdHs8/g+TLgFFLEE34crAc+a+wAY31diILtexEIy4PliN3g7JBPIEfCzRzsRMXcD3eB9FSwv4kdGNLfDfiVezCWfyN33EMr9Tgdx+8gyer8KtxC5fQhvX4EMexsYT95TF+Xny/Ft+/oF06yh+jK/o/M4Aa80EV7oUwfEgqhpUYWcL+Pvwm3X4wH8/rv+KP4lzMtyTL0DCsw3MV/eOllc0b8xOuYmIJZ7MwTjp+bSX1q6QgWns6RvQin8FsPCatTA9asDfHYBOmStt7BQsxA9fwNb4q4dRCqYB+XiYC/BvvG3mCp3BR323cJj+R3pJWZStORrv3c0TxDn2Kv9BQoCMt+ndhu+rPn07MifZId26MLGwIgzdwBgswBtOxP7iOKuMb8KcUSBm8Hzb3FAm3YFO0m+UkUGBjGO3GzApuFM4HPztn/KLgXypyCitCe0rK06pYgNPR3iStbB7eC8NncviPgn8zh2+TknpcgU9vhJ0fpBuqD7LOes85nobR0nnNQ08B7Mrhr8R7VAY3XLpGD0uFLA8rpZz7Xqojv1bR9kE7PsHrBboJ0m3RJfsn+j5pBV/M4OYFt7yK/XdD803MVROWxeDJJbQ7Qruuor8ZN6UAH8oY1yrl0qQcu2vC7gkFOZBXusfigFQHivAIvsDjOCrVhylY7E7SZt0+56WbcG4G9zK2S0G2yj5unaGpioeLBL0wHpvxs/Sn6TJ24+kc/SwpwLdz+LX615zKp6MG/wYF6yVHptbbkbvBKXxbbyeGMIT7FbcB8+ejwa+vB5wAAAAASUVORK5CYII=\n", | |
"text/latex": "$\\displaystyle \\frac{\\sqrt{6}}{2}$" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "## Expanding terms\nFrom a(b+c) to ab + ac" | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "from sympy.abc import x\n#same as x = sym.symbols('x')\nterm1 = 4*x + 5\nterm2 = x\nprint (term1 * term2)\ndisplay(Math(sym.latex(sym.expand(term1 * term2))))", | |
"execution_count": 107, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": "x*(4*x + 5)\n", | |
"name": "stdout" | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle x \\left(4 x + 5\\right)$" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "## Substitution of multiple variables in a loop" | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "import itertools\nfrom itertools import combinations \ndef multiSubst(expression, substitutions):\n #get the combination of all the elements with r length of pairs\n allValues = list(itertools.chain(*substitutions.values()))\n combs = list(set(list(combinations(allValues, len(substitutions.keys())) )))\n #sort the list of lists\n combs = sorted({tuple(x): x for x in combs}.values())\n display(Math(str(expression)))\n #create the generic function definition e.g. f(x,y)\n fText = 'f(' + ','.join(str(i) for i in substitutions.keys()) + ')'\n for comb in combs:\n text = 'When'\n substDict = {}\n i = 0\n for key in substitutions:\n substDict[key] = comb[i]\n if i == 0:\n text += \" \" + sym.latex(key) + \" = \" + str(comb[i])\n else:\n text += \" and \" + sym.latex(key) + \" = \" + str(comb[i])\n i = i +1\n display(Math('\\\\text{' + text + \", \" + '}'+ fText + \"=\" + str(expression.subs(substDict))))\n\nvals = [0,1,2]\nmyDict = {x:range(0,3),y:vals}\nmultiSubst((4+x)*(2-y),myDict)", | |
"execution_count": 174, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle (2 - y)*(x + 4)$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle \\text{When x = 0 and y = 0, }f(x,y)=8$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle \\text{When x = 0 and y = 1, }f(x,y)=4$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle \\text{When x = 0 and y = 2, }f(x,y)=0$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle \\text{When x = 1 and y = 0, }f(x,y)=10$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle \\text{When x = 1 and y = 1, }f(x,y)=5$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle \\text{When x = 1 and y = 2, }f(x,y)=0$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle \\text{When x = 2 and y = 0, }f(x,y)=12$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle \\text{When x = 2 and y = 1, }f(x,y)=6$" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.Math object>", | |
"text/latex": "$\\displaystyle \\text{When x = 2 and y = 2, }f(x,y)=0$" | |
}, | |
"metadata": {} | |
} | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"name": "python3", | |
"display_name": "Python 3", | |
"language": "python" | |
}, | |
"toc": { | |
"nav_menu": {}, | |
"number_sections": true, | |
"sideBar": true, | |
"skip_h1_title": false, | |
"base_numbering": 1, | |
"title_cell": "Table of Contents", | |
"title_sidebar": "Contents", | |
"toc_cell": false, | |
"toc_position": {}, | |
"toc_section_display": true, | |
"toc_window_display": false | |
}, | |
"language_info": { | |
"name": "python", | |
"version": "3.7.3", | |
"mimetype": "text/x-python", | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"pygments_lexer": "ipython3", | |
"nbconvert_exporter": "python", | |
"file_extension": ".py" | |
}, | |
"gist": { | |
"id": "f2dc2b21afb8fd62f67b26a55e7a0514", | |
"data": { | |
"description": "smypy solve algebra", | |
"public": true | |
} | |
}, | |
"_draft": { | |
"nbviewer_url": "https://gist.github.com/f2dc2b21afb8fd62f67b26a55e7a0514" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment