Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.129 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.75; '*S*': 0.01; 'equation': 0.16; 'expression,': 0.16; 'marco': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; 'math': 0.24; 'header :In-Reply-To:1': 0.27; 'phone:': 0.31; 'received:google.com': 0.35; 'starting': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'such': 0.63; 'strategy': 0.64; 'charset:windows-1252': 0.65; 'header:Reply-To:1': 0.67; 'reply- to:no real name:2**0': 0.71 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:message-id:date:reply-to:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=bPZld4/buh4j0ODfp/bxZ42EzPW1ahmAxCJhF0+3h/0=; b=DOgvQ0bDJdS1iqZZRKG9Ec+yGNzqxdFTb25Az+41BS7zxNeMY11LCK0NqXv32TfUfn CANVju5Row4H+lBj8Qmd2wt0gNFv/6kO/J18tCN3UgG8G+ac42I4y/eM9I9RIqZh0LLp fxC2U/2enXXbFONbpOwvB+GCESsvFdh4RyWAs8JN+X1eoq/A5+ELOzdTTwmgLPHcMUcz BmBfASKsOifIj8TY63+dOu6+GNvaMf1v87okdhHhLfqzqlTEopRJGJrSxKxS2YchtkOh cpHZxxG5nRNwstXFgHxyFdN6tD/a73pTy3VnCSFWr3zBB/6SHVXRI7fgiVrD3iYQ+HAE MWPQ== X-Received: by 10.180.9.73 with SMTP id x9mr13780521wia.20.1412166182083; Wed, 01 Oct 2014 05:23:02 -0700 (PDT) From: Marco Buttu X-Google-Original-From: Marco Buttu Date: Wed, 01 Oct 2014 14:22:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: how to parse standard algebraic notation References: <4a7f3e7a-ba4d-405e-a078-937bf861fcd8@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 01 Oct 2014 14:24:15 +0200 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: mbuttu@oa-cagliari.inaf.it List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1412166256 news.xs4all.nl 2895 [2001:888:2000:d::a6]:58182 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:78544 On 01/10/2014 09:01, math math wrote: > What would be a good starting strategy for writing a program to take the derivative of a polynomial expression, such as this below?: > "x**3 + x**2 + x + 1" You can look at sympy: >>> from sympy import * >>> equation = simplify("x**3 + x**2 + x + 1") >>> equation x**3 + x**2 + x + 1 >>> diff(equation) 3*x**2 + 2*x + 1 -- Marco Buttu INAF-Osservatorio Astronomico di Cagliari Via della Scienza n. 5, 09047 Selargius (CA) Phone: 070 711 80 217 Email: mbuttu@oa-cagliari.inaf.it