Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polyint #112

Merged
merged 2 commits into from
Mar 22, 2017
Merged

Polyint #112

merged 2 commits into from
Mar 22, 2017

Conversation

jverzani
Copy link
Member

Add definite integral interface to polyint, as mentioned in #110 .

@stevengj
Copy link
Member

LGTM.

Note that the docstring formatting here is nonstandard for Julia. If you follow the format of Base, it would be, for example:

"""
    polyint(p::Poly, k::Number=0)

Indefinite integral of a polynomial: integrate the polynomial `p` term
by term, optionally adding constant term `k`. The degree of the
resulting polynomial is one higher than the degree of `p`.


Examples:

polyint(Poly([1, 0, -1])) # Poly(x - 0.3333333333333333x^3)
polyint(Poly([1, 0, -1]), 2) # Poly(2.0 + x - 0.3333333333333333x^3)

See also `polyint(p, a, b)` for a definite integral over `[a,b]`.
"""

@stevengj
Copy link
Member

In principle, you could probably write a recurrence for P(b) - P(a) in terms of b-a, but I'm not sure it's worth it here.

@jverzani
Copy link
Member Author

Thanks for your help! I'll leave this as is. I'll open a separate issue about updating docstrings.

@jverzani jverzani merged commit ce6841a into JuliaMath:master Mar 22, 2017
@stevengj
Copy link
Member

Basically, one would want to work out the polynomial P(x + δ) in δ = b - a. See: http://math.stackexchange.com/questions/694565/polynomial-shift

@jverzani jverzani mentioned this pull request Mar 22, 2017
@jverzani jverzani deleted the polyint branch August 25, 2023 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants