# Determining Function Form (pattern matching maybe?)

**URL:** <https://cl.desmos.com/t/determining-function-form-pattern-matching-maybe/3626>\
**Category:** Questions\
**Created:** [August 29, 2021, 12:11am UTC](https://cl.desmos.com/t/determining-function-form-pattern-matching-maybe/3626 "2021-08-29T00:11:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryan\_Gregory](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/bryan_gregory/32/2029_2.png) [@Bryan\_Gregory](https://cl.desmos.com/u/Bryan_Gregory)\
**Post date:** [August 29, 2021, 12:11am UTC](https://cl.desmos.com/t/determining-function-form-pattern-matching-maybe/3626/1 "2021-08-29T00:11:01Z")

</div>

Hi There,

I’m looking to tighten up an activity I’m making where a student converts between standard and vertex form of quadratics.

I have everything looking great and the ability to check if what they enter is the same function however I’d like to add in a layer in which the CL will recognize if the student copy/pasted the prompt (which still reads as correct bc it is same function).

Here is the relevant page

> **[Converting between Vertex and Standard Form • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/612ac1b459324b6b8a918b97)**
>
> by Brian Savoie

Thanks!

Brian

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [August 29, 2021, 4:37am UTC](https://cl.desmos.com/t/determining-function-form-pattern-matching-maybe/3626/2 "2021-08-29T04:37:08Z")

</div>

Patterns might get a little hairy with possible integers or fractions, and needing some when-otherwise to switch between sum or difference depending on values of h or k.

Other options are using countNumberUsage, but again a little tricky with fractions, or the rather unreliable latex matching.

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [August 29, 2021, 7:30pm UTC](https://cl.desmos.com/t/determining-function-form-pattern-matching-maybe/3626/3 "2021-08-29T19:30:36Z")

</div>

I was reconsidering some of this. It will probably be easier to define vertex form and calculate standard form. This doesn’t change what you require of students as it happens in the background, although your preference of integers in one form over another would determine your choice.

---

<div class="post-metadata">

**Author:** ![Bryan\_Gregory](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/bryan_gregory/32/2029_2.png) [@Bryan\_Gregory](https://cl.desmos.com/u/Bryan_Gregory)\
**Post date:** [August 30, 2021, 2:09am UTC](https://cl.desmos.com/t/determining-function-form-pattern-matching-maybe/3626/4 "2021-08-30T02:09:37Z")

</div>

Thanks Daniel for the thoughts.

I’m not familiar at all with patterns which is why I reached out- there’s no documentation aside from the video series last year and I see lots of prompts in the CL layer once I start typing “pattern.”

I saw an option for “term1” and I’m wondering if I could pull out “term 1” from vertex form and then compare that specific function to an answer key in the calculator. (I’m imagining term 1 to be 2(x+1)^2 or something like)

But I either can’t get the syntax or “term 1” doesn’t work like that. Any thoughts?

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [August 30, 2021, 2:37am UTC](https://cl.desmos.com/t/determining-function-form-pattern-matching-maybe/3626/5 "2021-08-30T02:37:23Z")

</div>

I hadn’t seen anything for terms yet, so I’m unfamiliar.

So whatever the term is (I think) it would be something like:

```auto
p=patterns
term1=p.product(p.integer.satisfies(`x=2`),p.exponent(p.sum(p.literal(`x`),p.integer.satisfies(`x=1`)),p.integer.satisfies(`x=2`)))

```

I don’t think “term1” is actually a specific CL, but the name of a variable you may have seen in the videos. (Note: I didn’t actually check if this works, but this is how complicated patterns can get.)
