# Mathematica How to neglect specific terms in an expression?

1. Feb 6, 2019

### Robin04

I've just started using Mathematica and I'm still trying to get used to how things are properly done with it. I tried to do a calculation (this one: https://www.physicsforums.com/threads/lagrangian-of-a-driven-pendulum-landau-problem.965714/) and I had to neglect some terms in an expression.

Is there any tool in Mathematica where I can specify some condition like 'term has explicit time dependence' and it automatically throws out the terms that meet that condition? Or how is this done with these calculations? For now, I just subtracted it from the variable manually but I suppose there's some more elegant way of doing this.

EDIT: As the problem above has been solved I must add that I actually don't need to neglect terms there, because they fall out on their own, but I'm still curious if there are such tools in Mathematica.

Last edited: Feb 6, 2019
2. Feb 11, 2019

### PF_Help_Bot

Thanks for the thread! This is an automated courtesy bump. Sorry you aren't generating responses at the moment. Do you have any further information, come to any new conclusions or is it possible to reword the post? The more details the better.

3. Feb 13, 2019

### Bill Simpson

Will something like this

Select[a*t*Cos+c*Sin[t]+E^(t-1)+d*Cos+f-1,FreeQ[t]]

which returns this

-1 + f + d*Cos

correctly handle all the cases that you are considering?

You must be very careful with pattern matching methods like this and check that they correctly do exactly what you are expecting in every single case.

Notice for example

Select[a*t*Cos+(c+t)*Sin[g]+E^(t-1)+d*Cos+f-1,FreeQ[t]]

"incorrectly" returns

-1 + f + d*Cos