# 1.3.2 Constructing Procedure Using `Lambda`

In general, `lambda` is used to create procedures in the same way as `define`, except that no name is specified foir the procedure.


```scheme
(define plus4 (lambda (x) (+ x 4)))
```


```scheme
(plus4 3)
```




    7



## Using `let` to create local variables


```scheme
(define f (+ 2 3))
```


```scheme
f
```




    5




```scheme
(define (g) (+ 2 3))
```


```scheme
(g)
```




    5



$f(x, y) = x(1 + xy)^2 + y(1 - y) + (1 + xy)(1 - y)$

$$
\begin{align}
a &= 1 + xy \\
b &= 1 - y \\
f(x, y) &= xa^2 + yb + ab
\end{align}
$$


```scheme
(define (square x) (* x x))
```


```scheme
(define (f x y)
  (let
    ((a (+ 1 (* x y)))
     (b (- 1 y)))
    (+ (* x (square a))
       (* y b)
       (* a b))))
```


```scheme
(f 2 4)
```




    123



> A `let` expression is simply syntatic sugar for the underlying `lambda` expression.


```scheme

```

41a88987d1830978bbb3b2d3aa5aa67422405923
ipynb
Jupyter Notebook
chapter01/sec1.3.2.ipynb
tyohei/sicp2e
733f17f112fb43117b37c663ee1be33afc3794d8
MIT
chapter01/sec1.3.2.ipynb
tyohei/sicp2e
733f17f112fb43117b37c663ee1be33afc3794d8
MIT
chapter01/sec1.3.2.ipynb
tyohei/sicp2e
733f17f112fb43117b37c663ee1be33afc3794d8
MIT
Qwen/Qwen-72B
1. YES
2. YES