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

  • SEARCH
  • Home
  • 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 459259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:45:17+00:00 2026-05-12T22:45:17+00:00

I generate very long and complex analytic expressions of the general form: (…something not

  • 0

I generate very long and complex analytic expressions of the general form:

(...something not so complex...)(...ditto...)(...ditto...)...lots...

When I try to use Simplify, Mathematica grinds to a halt, I am assuming due to the fact that it tries to expand the brackets and or simplify across different brackets. The brackets, while containing long expressions, are easily simplified by Mathematica on their own. Is there some way I can limit the scope of Simplify to a single bracket at a time?

Edit: Some additional info and progress.

So using the advice from you guys I have now started using something in the vein of

In[1]:= trouble = Log[(x + I y) (x - I y) + Sqrt[(a + I b) (a - I b)]];

In[2]:= Replace[trouble, form_ /; (Head[form] == Times) :> Simplify[form],{3}]

Out[2]= Log[Sqrt[a^2 + b^2] + (x - I y) (x + I y)]

Changing Times to an appropriate head like Plus or Power makes it possible to target the simplification quite accurately. The problem / question that remains, though, is the following: Simplify will still descend deeper than the level specified to Replace, e.g.

In[3]:= Replace[trouble, form_ /; (Head[form] == Plus) :> Simplify[form], {1}]

Out[3]= Log[Sqrt[a^2 + b^2] + x^2 + y^2]

simplifies the square root as well.

My plan was to iteratively use Replace from the bottom up one level at a time, but this clearly will result in vast amount of repeated work by Simplify and ultimately result in the exact same bogging down of Mathematica I experienced in the outset. Is there a way to restrict Simplify to a certain level(s)?

I realize that this sort of restriction may not produce optimal results, but the idea here is getting something that is “good enough”.

  • 1 1 Answer
  • 5 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-12T22:45:17+00:00Added an answer on May 12, 2026 at 10:45 pm

    There are a number of ways you can do this, but it can be a little tricky and depends on the structure of your actual expression. However, usually a product of a number of terms in brackets will have the head Times, and you can use FullForm to verify this:

    In[1]:= FullForm[(a+b)(c+d)]
    Out[1]= Times[Plus[a, b], Plus[c, d]]
    

    You can use the higher-order function Map with expressions with head Times the same way you use it with expressions with head List, and that may allow you to Simplify the expression one term at a time, like so:

    Map[Simplify, yourGinormousExpression]
    

    You can use Expand on the result if you need to subsequently expand out the brackets.

    EDIT to add: If you want to specify the forms that you do want to simplify, you can use Replace or ReplaceAll instead of one of the relatives of Map. Replace is particularly useful because it takes a level specification, allowing you to only affect the factors in the topmost product. As a simple example, consider the following:

    In[1]:= expr = Sqrt[(a + 1)/a] Sqrt[(b + 1)/b];
    
    In[2]:= Simplify[expr]
    Out[2]= Sqrt[1 + 1/a] Sqrt[1 + 1/b]
    

    If you don’t want to simplify factors that depend on a. you can do this instead:

    In[3]:= Replace[expr, form_ /; FreeQ[form, a] :> Simplify[form], {1}]
    Out[3]= Sqrt[(1 + a)/a] Sqrt[1 + 1/b]
    

    Only the second term, which depends on b, has been changed. One thing to bear in mind though is that some transformations are done automatically by Times or Plus; for instance a + a will be turned into 2 a even without use of Simplify.

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

Sidebar

Related Questions

I would like to use R to generate a very basic world map with
I have a very long list in a numpy.array . I want to generate
Tricky question. I have a very long form where the user writes down a
I've just finished a month long project of building a very complex map /
I have a couple of very long procs in Oracle 2000+ lines with lots
I am using Python to generate an ASCII file composed of very long lines.
i would like to generate a very simple report with some images and text
As part of an attempt to generate a very simple looking sky, I've created
To generate the following markup: <label class=foo>Bar</label> The PHP will look something like: <?php
I have a very long list of dictionaries with string indices and integer values.

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.