def TR1(rv):
 def f(rv):
  if (rv.func is sec):
   a = rv.args[0]
   return (S.One / cos(a))
  elif (rv.func is csc):
   a = rv.args[0]
   return (S.One / sin(a))
  return rv
 return bottom_up(rv, f)

def TR1 ( rv ) : def f ( rv ) : if ( rv . func is sec ) : a = rv . args [ 0 ] return ( S . One / cos ( a ) ) elif ( rv . func is csc ) : a = rv . args [ 0 ] return ( S . One / sin ( a ) ) return rv return bottom_up ( rv , f )
replace sec .