title: extracting just first order terms of equation
body: <p>I need to extract just the terms of the equation which just have one term of <code>tau</code>. 
  I have been using the <code>SymPy</code> module but I am new to it.</p>
  
  <p>I have an equation similar to this (which arises from some matrix manipulations).</p>
  
  <pre><code>m=cos(alpha)*sin(theta)+
    cos(alpha)*sin(theta)*sin(tau)+
    sin(theta)*sin(tau)*cos(tau)+
    sin(tau)**2
  </code></pre>
  
  <p>Then using <code>O(tau**2)</code> and doing something like</p>
  
  <pre><code>m2=m+O(tau**2)
  m1=m2.removeO()+O(tau)
  m1=m-m1.removeO()
  </code></pre>
  
  <p>To leave me with m1 being just the tau terms.
  This almost works however it won't pick up the <code>sin(theta)*sin(tau)*cos(tau)</code> term. To be clear I need this to be picked up in the <code>tau**2</code> terms.</p>
  
  <p>If I use the Euler identities this will give a term of the form <code>e**2tau</code> where I am only interested in the <code>e**tau</code> terms. However I can't see a way to do this all in terms of exponentials and just strip out the <code>e**(tau)</code> terms.</p>
  
  <p>It is in fact the exponential terms that I am interested in just the tau and not the 2tau terms (these terms have a different physical meaning). However I am struggling to find a way to go about it. </p>
  
  <p>I presume there is an obvious answer that I am just missing.</p>