Your result should be at least minimally simplified, using the following rules:
0 + expr --> expr expr + 0 --> expr num + num --> their sum 0 * expr --> 0 expr * 0 --> 0 1 * expr --> expr expr * 1 --> expr num * num --> their product
Examples:
deriv "(+ x 3)" "x" => "1" deriv "(* x y)" "x" => "y" deriv "3" "x" => "0" deriv "(+ (* x 3) (* x 2))" "x" => "5" deriv "(* (* x y) (+ x 3))" "x" => "(+ (* x y) (* y (+ x 3)))"
Miranda deriv "(+ x 3)" "x"
1
Miranda deriv "(* x y)" "x"
y
Miranda deriv "3" "x"
0
Miranda deriv "(+ (* x 3) (* x 2))" "x"
5
Miranda deriv "(* (* x y) (+ x 3))" "x"
(+ (* x y) (* y (+ x 3)))
Miranda deriv "(+ 10 hello)" "x"
0
Miranda deriv "(+ 10 hello)" "hello"
1
Miranda deriv "(* catch 22)" "catch"
22
Miranda deriv "(* (+ 5 1) x)" "x"
6