using closed-form solutions