Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 647785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:45:38+00:00 2026-05-13T21:45:38+00:00

I have a range of data that I have approximated using a polynomial of

  • 0

I have a range of data that I have approximated using a polynomial of degree 2 in Python. I want to calculate the area underneath this polynomial between 0 and 1.

Is there a calculus, or similar package from numpy that I can use, or should I just make a simple function to integrate these functions?

I’m a little unclear what the best approach for defining mathematical functions is.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:45:39+00:00Added an answer on May 13, 2026 at 9:45 pm

    If you’re integrating only polynomials, you don’t need to represent a general mathematical function, use numpy.poly1d, which has an integ method for integration.

    >>> import numpy
    >>> p = numpy.poly1d([2, 4, 6])
    >>> print p
       2
    2 x + 4 x + 6
    >>> i = p.integ()
    >>> i
    poly1d([ 0.66666667,  2.        ,  6.        ,  0.        ])
    >>> integrand = i(1) - i(0) # Use call notation to evaluate a poly1d
    >>> integrand
    8.6666666666666661
    

    For integrating arbitrary numerical functions, you would use scipy.integrate with normal Python functions for functions. For integrating functions analytically, you would use sympy. It doesn’t sound like you want either in this case, especially not the latter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have data that is mostly centered in a small range (1-10) but there
I have a range of parameters that are passed via jQuery Ajax to an
I have two fields representing data range (from and to). I need to check
I'm using the pellet reasoner on a number of ontologies and have run the
I have just started learning C# and would have one question that I cannot
Possible Duplicate: Circle line collision detection I'm trying to do collision testing between a
I've got a query that I've just found in the database that is failing
I am writing a software package whose job is to export DB data from
What I need is: plots creation, stuff for interpolation, stuff for counting such things
I am generating multi-series graphs with the date along the X-Axis. The problem is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.