For a nontrivial additive character lambda and a multiplicative character chi of the finite field with q elements (q a power of an odd prime), and for each positive integer r, the exponential sums Sigma lambda((tr w)(r)) over w is an element of SO(2n + 1,q) and Sigma chi (det w)lambda((tr w)(r)) over O(2n + 1, q) are considered. We show that both of them can be expressed as polynomials in q involving certain exponential sums. Also, from these expressions we derive the formulas for the number of elements w in SO(2n + 1, q) and O(2n + 1, q) with (tr w)(r) = beta, for each beta in the finite field with q elements.