maaz.code logo
Simple view

Mergedsympy/sympy#3089515.1Kstars

integrals: fix free_symbols of transforms with expression variables

By Mohd Maaz Khan, merged by smichr into sympy/sympy on 31 Oct 2026

+11−311 lines added, 3 lines removed3 files changed2 comments

Conversation

  1. maaz7409opened this pull request on 30 Oct 2026description.mdAuthor

    References to other Issues or PRs

    None.

    Brief description of what is fixed or changed

    IntegralTransform.free_symbols put the transform variable itself in the set instead of its free symbols, so for e.g. LaplaceTransform(f(t), t, s - 2) it returned {s - 2} instead of {s}. Because of that:

    • .diff(s) of a transform whose variable is 2*s, s + 1, etc. returned 0 (Laplace, Fourier, Mellin, ...).
    • inverse_laplace_transform(LaplaceTransform(f(t), t, s - 2), s, t) returned 0; it is now left unevaluated.

    The fix uses transform_variable.free_symbols. Added tests for both cases.

    Other comments

    None.

    AI Generation Disclosure

    Claude Code (Claude Opus 5.5) was used to find the bug, to make the edits and commit it. I have reviewed the changes.

    Release Notes

    • integrals
      • Fixed free_symbols of unevaluated integral transforms whose transform variable is an expression. Formerly, LaplaceTransform(f(t), t, 2*s).diff(s) incorrectly gave 0, and inverse_laplace_transform(LaplaceTransform(f(t), t, s - 2), s, t) incorrectly gave 0.
  2. sympy-botcommented on 30 Oct 2026

    :white_check_mark:

    Hi, I am the SymPy bot. I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

    Your release notes are in good order.

    Here is what the release notes will look like:

    • integrals
      • Fixed free_symbols of unevaluated integral transforms whose transform variable is an expression. Formerly, LaplaceTransform(f(t), t, 2*s).diff(s) incorrectly gave 0, and inverse_laplace_transform(LaplaceTransform(f(t), t, s - 2), s, t) incorrectly gave 0. (#30895 by @maaz7409)

    This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.15.

    Click here to see the pull request description that was parsed.

    #### References to other Issues or PRs
    
    
    
    None.
    
    #### Brief description of what is fixed or changed
    
    `IntegralTransform.free_symbols` put the transform variable itself in the set
    instead of its free symbols, so for e.g. `LaplaceTransform(f(t), t, s - 2)`
    it returned `{s - 2}` instead of `{s}`. Because of that:
    
    - `.diff(s)` of a transform whose variable is `2*s`, `s + 1`, etc. returned `0`
      (Laplace, Fourier, Mellin, ...).
    - `inverse_laplace_transform(LaplaceTransform(f(t), t, s - 2), s, t)` returned
      `0`; it is now left unevaluated.
    
    The fix uses `transform_variable.free_symbols`. Added tests for both cases.
    
    #### Other comments
    
    None.
    
    #### AI Generation Disclosure
    
    
    
    Claude Code (Claude Opus 5.5) was used to find the bug, to make the edits and commit it. I have reviewed the changes. 
    
    #### Release Notes
    
    
    
    
    * integrals
      * Fixed `free_symbols` of unevaluated integral transforms whose transform variable is an expression. Formerly, `LaplaceTransform(f(t), t, 2*s).diff(s)` incorrectly gave `0`, and `inverse_laplace_transform(LaplaceTransform(f(t), t, s - 2), s, t)` incorrectly gave `0`.
    

    Update

    The release notes on the wiki have been updated.

  3. smichrcommented on 31 Oct 2026Member

    Looks good, thanks!

  4. smichrmerged this pull request on 31 Oct 2026

Copied from GitHub when this site was built; comments by bots are left out.