Also, feel free to use x**2 rather than pow(x, 2) .  Your integrand here is
not the same as what you put in to the integral calculator.


On Sat, Apr 5, 2014 at 8:38 AM, Matthew Rocklin <[email protected]> wrote:

> Symbol should be upper case.  Other than that everything is fine.  You
> also might want to update your sympy version at some point
>
> In [1]: from sympy import *
> In [2]: x = Symbol('x')
>
> In [3]: d = diff(2 * pow(x, 2), x)
> In [4]: d
> Out[4]: 4*x
>
> In [5]: length = integrate(sqrt(1 + pow(d, 2)), (x, 5, 10))
> In [6]: length
> Out[6]: -5*sqrt(401)/2 - asinh(20)/8 + asinh(40)/8 + 5*sqrt(1601)
>
>
>
> On Sat, Apr 5, 2014 at 4:00 AM, Groover <[email protected]> wrote:
>
>> Hello,
>>
>> It's been 20 years since I did any calculus, so please be gentle. :)
>>
>> Using SymPy 0.7.2 and IronPython 2.7.4.
>>
>> import sympy
>> from sympy import *
>>
>> # calculate arc length
>> x = symbol('x')
>> d = diff(2 * pow(x, 2), x)
>> print d
>> length = integrate(sqrt(1 + pow(d, 2)), (x, 5, 10))
>> print length
>>
>> This outputs '4*x' as expected then 'zip() argument after * must be a
>> sequence, not dictionary-itemiterator'.
>>
>> I believe the integration is solvable to 75.173 [1], so I assume I have
>> an error in my Python and/or SymPy syntax. Can anyone please give me some
>> pointers? Thanks!
>>
>> [1]
>> http://www.integral-calculator.com/#expr=sqrt%281%2B%284x%5E2%29%29&ubound=10&lbound=5
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sympy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/sympy.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/sympy/dfee71bf-d071-44a8-8772-f8d8f75ae855%40googlegroups.com<https://groups.google.com/d/msgid/sympy/dfee71bf-d071-44a8-8772-f8d8f75ae855%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAJ8oX-FRBBVxaC71UOpF9pbCeRW-qGWvo3t9YYMyJsvUCfg6ew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to