Matching question



I have a pattern matching function quadratic_match, which
takes the arguments expr and x and binds fn_a, fn_b, and fn_c to a,b and
c in
a*x^2+b*x+c if the expression is a quadratic in x.

I want to match the quadratic in the following:
'integrate(sin(a*x^2),x) and replace it with jello(fn_a).

So I declare the following match variables:
matchdeclare(v,true)
matchdeclare(u,quadratic_match(u,v))
and the rule:
defrule(s1,'integrate(sin(u),v),jello(fn_a)).
when I execute
apply1('integrate(sin(a*x^2),x),s1) I get 'integrate(sin(a * x^2),x)
Tracing quadratic match, I get
1 Enter quadratic_match [false, false, a * x^2]
1 Exit  quadratic_match false

Can someone explain what I am doing wrong?
Thanks,
Dan Stanger