Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm solving systems of equations with a few different functions of time, t, and so I'm getting output with lots of [t] running around. Is there a way to display these functions without the dependences, e.g., to display

a[t] b'[t]

as

a b'

? I can use a series of replacement rules to do this, e.g.,

/.{a[t]->a,b[t]->b}

but this is pretty cumbersome, and doesn't generalize well (e.g., when more functions are added in).

share|improve this question
1  
Something like a[t] b'[t] /. f_[t] :> f? Please note that this could fail, depending on your expression. –  Yves Klett Jan 10 at 12:22
    
Hi Yves, that works, thanks! Why do you use the delayed :> instead of ->? –  Adam Jan 10 at 12:30
    
Right, Rule (-> ) works just as well in your case :) –  Yves Klett Jan 10 at 12:44
3  
@Yves With respect, no, it does not. You should use :> with named patterns on the right-hand-side. Otherwise if f has a global value the replacement will break. –  Mr.Wizard Jan 10 at 12:49
    
This rule does not work for all functions of the independent variable. For example a[t] Exp[t] gives a Exp[t]. But may be that is ok with the OP, just wanted to point it out just in case. –  Nasser Jan 10 at 12:51
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.